diff --git a/CHANGELOG.md b/CHANGELOG.md index e356f22c..211dc63b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,18 @@ uid: changelog # Changelog +## [1.3.8] - 2024-11-08 + +### Removed + +* removing various material assets within entities (Test.mat and TestMaterial.mat). + +### Fixed + +* Disable "new empty subscene" menu item on default untitled scene. +* Fix invalid queries generated for `IJobEntity` with `[WithPresent(typeof(T))]` and `EnabledRef` and/or `in T` in the same job. + + ## [1.3.5] - 2024-10-04 ### Changed @@ -19,6 +31,7 @@ uid: changelog * Exception thrown under certain circumstances when a system was destroyed could break various DOTS editor windows. + ## [1.3.2] - 2024-09-06 ### Added diff --git a/Unity.Entities.TestComponents/DependencyTestAuthoring.cs b/Unity.Entities.TestComponents/DependencyTestAuthoring.cs index b3cb7379..cbb3c193 100644 --- a/Unity.Entities.TestComponents/DependencyTestAuthoring.cs +++ b/Unity.Entities.TestComponents/DependencyTestAuthoring.cs @@ -1,4 +1,5 @@ using System; +using UnityEditor; using UnityEngine; namespace Unity.Entities.Tests @@ -19,9 +20,27 @@ public override void Bake(DependencyTestAuthoring authoring) DependsOn(authoring.GameObject); // This test shouldn't require transform components var entity = GetEntity(TransformUsageFlags.None); + Color color = default; + if (authoring.Material) + { + DependsOn(authoring.Material); + color = authoring.Material.color; + } + else + { +#if UNITY_EDITOR + var material = AssetDatabase.LoadAssetAtPath("Assets/TestMaterial.asset"); + if (material != null) + { + DependsOn(material); + color = material.color; + } +#endif + } + AddComponent(entity, new ConversionDependencyData { - MaterialColor = DependsOn(authoring.Material) != null ? authoring.Material.color : default, + MaterialColor = color, HasMaterial = DependsOn(authoring.Material) != null, TextureFilterMode = DependsOn(authoring.Texture) != null ? authoring.Texture.filterMode : default, HasTexture = DependsOn(authoring.Texture) != null diff --git a/Unity.Entities.Tests/ForEachCodegen/JobEntityISystemTests.cs b/Unity.Entities.Tests/ForEachCodegen/JobEntityISystemTests.cs index 523afe02..d0f0a391 100644 --- a/Unity.Entities.Tests/ForEachCodegen/JobEntityISystemTests.cs +++ b/Unity.Entities.Tests/ForEachCodegen/JobEntityISystemTests.cs @@ -33,6 +33,7 @@ public void SetUp() TestEntity = m_Manager.CreateEntity(myArch); m_Manager.SetComponentData(TestEntity, new EcsTestData { value = 3 }); m_Manager.SetComponentData(TestEntity, new EcsTestData2 { value0 = 4 }); + m_Manager.SetComponentData(TestEntity, new EcsTestDataEnableable { value = 17 }); var buffer = m_Manager.GetBuffer(TestEntity); buffer.Add(new EcsIntElement { Value = 18 }); buffer.Add(new EcsIntElement { Value = 19 }); @@ -97,7 +98,13 @@ ref SystemState GetSystemStateRef() public void WithDisabled() => GetTestSystemUnsafe().WithDisabled(ref GetSystemStateRef()); [Test] - public void EnableDisabled() => GetTestSystemUnsafe().EnableDisabled(ref GetSystemStateRef()); + public void WithDisabled_RefRW() => GetTestSystemUnsafe().WithDisabled_RefRW(ref GetSystemStateRef()); + + [Test] + public void WithDisabled_EnabledRefRW() => GetTestSystemUnsafe().WithDisabled_EnabledRefRW(ref GetSystemStateRef()); + + [Test] + public void WithDisabled_RefRW_EnabledRefRW() => GetTestSystemUnsafe().WithDisabled_RefRW_EnabledRefRW(ref GetSystemStateRef()); [Test] public void WithAbsent() => GetTestSystemUnsafe().WithAbsent(ref GetSystemStateRef()); @@ -105,6 +112,15 @@ ref SystemState GetSystemStateRef() [Test] public void WithPresent() => GetTestSystemUnsafe().WithPresent(ref GetSystemStateRef()); + [Test] + public void WithPresent_RefRW() => GetTestSystemUnsafe().WithPresent_RefRW(ref GetSystemStateRef()); + + [Test] + public void WithPresent_EnabledRefRW() => GetTestSystemUnsafe().WithPresent_EnabledRefRW(ref GetSystemStateRef()); + + [Test] + public void WithPresent_RefRW_EnabledRefRW() => GetTestSystemUnsafe().WithPresent_RefRW_EnabledRefRW(ref GetSystemStateRef()); + [Test] public void WithAny_DoesntExecute_OnEntityWithoutThatComponent() => GetTestSystemUnsafe().WithAny_DoesntExecute_OnEntityWithoutThatComponent(ref GetSystemStateRef()); @@ -239,11 +255,31 @@ partial struct WithDisabledJob : IJobEntity } [WithDisabled(typeof(EcsTestDataEnableable))] - partial struct EnableDisabledJob : IJobEntity + partial struct WithDisabled_RefRW_Job : IJobEntity + { + public int disabledValue; + + void Execute(ref EcsTestData e1, RefRW ref2) => e1.value = disabledValue + ref2.ValueRO.value; + } + + [WithDisabled(typeof(EcsTestDataEnableable))] + partial struct WithDisabled_EnabledRefRW_Job : IJobEntity { void Execute(EnabledRefRW e1) => e1.ValueRW = true; } + [WithDisabled(typeof(EcsTestDataEnableable))] + partial struct WithDisabled_RefRW_EnabledRefRW_Job : IJobEntity + { + public int disabledValue; + + void Execute(ref EcsTestData e1, EnabledRefRW e2, RefRW ref2) + { + e1.value = disabledValue + ref2.ValueRO.value; + e2.ValueRW = true; + } + } + [WithAbsent(typeof(EcsTestData3))] partial struct WithAbsentJob : IJobEntity { @@ -260,6 +296,38 @@ partial struct WithPresentJob : IJobEntity void Execute(ref EcsTestData e1) => e1.value = presentValue; } + [WithPresent(typeof(EcsTestDataEnableable))] + partial struct WithPresent_RefRW_Job : IJobEntity + { + public int presentValue; + + void Execute(ref EcsTestData e1, RefRW ref2) => e1.value = presentValue + ref2.ValueRO.value; + } + + [WithPresent(typeof(EcsTestDataEnableable))] + partial struct WithPresent_EnabledRefRW_Job : IJobEntity + { + public int presentValue; + + void Execute(ref EcsTestData e1, EnabledRefRW eref2) + { + e1.value = presentValue; + eref2.ValueRW = !eref2.ValueRO; + } + } + + [WithPresent(typeof(EcsTestDataEnableable))] + partial struct WithPresent_RefRW_EnabledRefRW_Job : IJobEntity + { + public int presentValue; + + void Execute(ref EcsTestData e1, RefRW ref2, EnabledRefRW eref2) + { + e1.value = presentValue + ref2.ValueRO.value; + eref2.ValueRW = !eref2.ValueRO; + } + } + [WithAny(typeof(EcsTestData3))] partial struct WithAny_DoesntExecute_OnEntityWithoutThatComponentJob : IJobEntity { @@ -395,14 +463,32 @@ public void WithDisabled(ref SystemState state) Assert.AreEqual(1, state.EntityManager.GetComponentData(JobEntityISystemTests.TestEntity).value); } - public void EnableDisabled(ref SystemState state) + public void WithDisabled_RefRW(ref SystemState state) + { + new WithDisabled_RefRW_Job{ disabledValue = 1 }.Schedule(); + state.Dependency.Complete(); + Assert.AreEqual(1+17, state.EntityManager.GetComponentData(JobEntityISystemTests.TestEntity).value); + } + + public void WithDisabled_EnabledRefRW(ref SystemState state) + { + Assert.AreEqual(1, SystemAPI.QueryBuilder().WithDisabled().Build().CalculateEntityCount()); + Assert.AreEqual(0, SystemAPI.QueryBuilder().WithAll().Build().CalculateEntityCount()); + new WithDisabled_EnabledRefRW_Job{}.Schedule(); + state.Dependency.Complete(); + Assert.AreEqual(0, SystemAPI.QueryBuilder().WithDisabled().Build().CalculateEntityCount()); + Assert.AreEqual(1, SystemAPI.QueryBuilder().WithAll().Build().CalculateEntityCount()); + } + + public void WithDisabled_RefRW_EnabledRefRW(ref SystemState state) { Assert.AreEqual(1, SystemAPI.QueryBuilder().WithDisabled().Build().CalculateEntityCount()); Assert.AreEqual(0, SystemAPI.QueryBuilder().WithAll().Build().CalculateEntityCount()); - new EnableDisabledJob{}.Schedule(); + new WithDisabled_RefRW_EnabledRefRW_Job{ disabledValue = 1 }.Schedule(); state.Dependency.Complete(); Assert.AreEqual(0, SystemAPI.QueryBuilder().WithDisabled().Build().CalculateEntityCount()); Assert.AreEqual(1, SystemAPI.QueryBuilder().WithAll().Build().CalculateEntityCount()); + Assert.AreEqual(1+17, state.EntityManager.GetComponentData(JobEntityISystemTests.TestEntity).value); } public void WithAbsent(ref SystemState state) @@ -426,6 +512,50 @@ public void WithPresent(ref SystemState state) Assert.AreEqual(2, state.EntityManager.GetComponentData(JobEntityISystemTests.TestEntity).value); } + public void WithPresent_RefRW(ref SystemState state) + { + // Test with the present component disabled + state.EntityManager.SetComponentEnabled(JobEntityISystemTests.TestEntity, false); + new WithPresent_RefRW_Job{ presentValue= 1}.Schedule(); + state.Dependency.Complete(); + Assert.AreEqual(1+17, state.EntityManager.GetComponentData(JobEntityISystemTests.TestEntity).value); + // test again with the present component enabled + state.EntityManager.SetComponentEnabled(JobEntityISystemTests.TestEntity, true); + new WithPresent_RefRW_Job{ presentValue= 2}.Schedule(); + state.Dependency.Complete(); + Assert.AreEqual(2+17, state.EntityManager.GetComponentData(JobEntityISystemTests.TestEntity).value); + } + + public void WithPresent_EnabledRefRW(ref SystemState state) + { + // Test with the present component disabled + state.EntityManager.SetComponentEnabled(JobEntityISystemTests.TestEntity, false); + new WithPresent_EnabledRefRW_Job{ presentValue= 1}.Schedule(); + state.Dependency.Complete(); + Assert.AreEqual(1, state.EntityManager.GetComponentData(JobEntityISystemTests.TestEntity).value); + Assert.IsTrue(state.EntityManager.IsComponentEnabled(JobEntityISystemTests.TestEntity)); + // test again with the present component enabled + new WithPresent_EnabledRefRW_Job{ presentValue= 2}.Schedule(); + state.Dependency.Complete(); + Assert.AreEqual(2, state.EntityManager.GetComponentData(JobEntityISystemTests.TestEntity).value); + Assert.IsFalse(state.EntityManager.IsComponentEnabled(JobEntityISystemTests.TestEntity)); + } + + public void WithPresent_RefRW_EnabledRefRW(ref SystemState state) + { + // Test with the present component disabled + state.EntityManager.SetComponentEnabled(JobEntityISystemTests.TestEntity, false); + new WithPresent_RefRW_EnabledRefRW_Job{ presentValue= 1}.Schedule(); + state.Dependency.Complete(); + Assert.AreEqual(1+17, state.EntityManager.GetComponentData(JobEntityISystemTests.TestEntity).value); + Assert.IsTrue(state.EntityManager.IsComponentEnabled(JobEntityISystemTests.TestEntity)); + // test again with the present component enabled + new WithPresent_RefRW_EnabledRefRW_Job{ presentValue= 2}.Schedule(); + state.Dependency.Complete(); + Assert.AreEqual(2+17, state.EntityManager.GetComponentData(JobEntityISystemTests.TestEntity).value); + Assert.IsFalse(state.EntityManager.IsComponentEnabled(JobEntityISystemTests.TestEntity)); + } + public void WithAny_DoesntExecute_OnEntityWithoutThatComponent(ref SystemState state) { new WithAny_DoesntExecute_OnEntityWithoutThatComponentJob { one = 1 }.Schedule(); diff --git a/Unity.Entities/SourceGenerators/AspectGenerator.dll b/Unity.Entities/SourceGenerators/AspectGenerator.dll index fedf8b0e..4c3f7153 100644 Binary files a/Unity.Entities/SourceGenerators/AspectGenerator.dll and b/Unity.Entities/SourceGenerators/AspectGenerator.dll differ diff --git a/Unity.Entities/SourceGenerators/AspectGenerator.pdb b/Unity.Entities/SourceGenerators/AspectGenerator.pdb index 4a92d9d9..495c31ac 100644 Binary files a/Unity.Entities/SourceGenerators/AspectGenerator.pdb and b/Unity.Entities/SourceGenerators/AspectGenerator.pdb differ diff --git a/Unity.Entities/SourceGenerators/Common.dll b/Unity.Entities/SourceGenerators/Common.dll index a925b34a..b83847c4 100644 Binary files a/Unity.Entities/SourceGenerators/Common.dll and b/Unity.Entities/SourceGenerators/Common.dll differ diff --git a/Unity.Entities/SourceGenerators/Common.pdb b/Unity.Entities/SourceGenerators/Common.pdb index c3293739..8b97537a 100644 Binary files a/Unity.Entities/SourceGenerators/Common.pdb and b/Unity.Entities/SourceGenerators/Common.pdb differ diff --git a/Unity.Entities/SourceGenerators/JobEntityGenerator.dll b/Unity.Entities/SourceGenerators/JobEntityGenerator.dll index b5358a17..c4feaa19 100644 Binary files a/Unity.Entities/SourceGenerators/JobEntityGenerator.dll and b/Unity.Entities/SourceGenerators/JobEntityGenerator.dll differ diff --git a/Unity.Entities/SourceGenerators/JobEntityGenerator.pdb b/Unity.Entities/SourceGenerators/JobEntityGenerator.pdb index 98fda164..ce4f7c77 100644 Binary files a/Unity.Entities/SourceGenerators/JobEntityGenerator.pdb and b/Unity.Entities/SourceGenerators/JobEntityGenerator.pdb differ diff --git a/Unity.Entities/SourceGenerators/Source~/JobEntityGenerator/JobEntityDescription.cs b/Unity.Entities/SourceGenerators/Source~/JobEntityGenerator/JobEntityDescription.cs index 4bb77450..87ca8737 100644 --- a/Unity.Entities/SourceGenerators/Source~/JobEntityGenerator/JobEntityDescription.cs +++ b/Unity.Entities/SourceGenerators/Source~/JobEntityGenerator/JobEntityDescription.cs @@ -591,7 +591,7 @@ public void FillFromAttributes(SyntaxList attributeLists, S case SimpleNameSyntax { Identifier.ValueText: "WithPresent" }: if (attribute.ArgumentList != null) foreach (var argument in attribute.ArgumentList.Arguments) - AddQueryInstanceFromAttribute(QueryPresentTypes, argument, QueryType.Present, semanticModel, removeFromQueryAllIfFound: false); + AddQueryInstanceFromAttribute(QueryPresentTypes, argument, QueryType.Present, semanticModel, removeFromQueryAllIfFound: true); break; case SimpleNameSyntax { Identifier.ValueText: "WithAbsent" }: if (attribute.ArgumentList != null) diff --git a/Unity.Entities/SourceGenerators/Source~/Mock/Unity.Entities.Mock/EntitiesMock.cs b/Unity.Entities/SourceGenerators/Source~/Mock/Unity.Entities.Mock/EntitiesMock.cs index fe34e483..9d43397c 100644 --- a/Unity.Entities/SourceGenerators/Source~/Mock/Unity.Entities.Mock/EntitiesMock.cs +++ b/Unity.Entities/SourceGenerators/Source~/Mock/Unity.Entities.Mock/EntitiesMock.cs @@ -35,6 +35,8 @@ public void Reset() public EntityQueryBuilder WithDisabled() => this; public EntityQueryBuilder WithDisabledRW() => this; public EntityQueryBuilder WithAbsent() => this; + public EntityQueryBuilder WithPresent() => this; + public EntityQueryBuilder WithPresentRW() => this; public EntityQueryBuilder WithAspect() => this; public EntityQueryBuilder WithOptions(EntityQueryOptions options) => this; public EntityQueryBuilder AddAdditionalQuery() => this; @@ -81,6 +83,14 @@ public sealed class WithDisabledAttribute : Attribute { public WithDisabledAttribute(params Type[] types){} } + public sealed class WithAbsentAttribute : Attribute + { + public WithAbsentAttribute(params Type[] types){} + } + public sealed class WithPresentAttribute : Attribute + { + public WithPresentAttribute(params Type[] types){} + } public sealed class WithChangeFilterAttribute : Attribute { public WithChangeFilterAttribute(params Type[] types){} @@ -476,6 +486,7 @@ public struct SystemAPIQueryBuilder public SystemAPIQueryBuilder WithNone() => default; public SystemAPIQueryBuilder WithDisabled() => default; public SystemAPIQueryBuilder WithAbsent() => default; + public SystemAPIQueryBuilder WithPresent() => default; public SystemAPIQueryBuilder WithOptions(EntityQueryOptions options) => default; public EntityQuery Build() => default; } diff --git a/Unity.Entities/SourceGenerators/SystemGenerator.Common.dll b/Unity.Entities/SourceGenerators/SystemGenerator.Common.dll index ea0d6220..d12adeec 100644 Binary files a/Unity.Entities/SourceGenerators/SystemGenerator.Common.dll and b/Unity.Entities/SourceGenerators/SystemGenerator.Common.dll differ diff --git a/Unity.Entities/SourceGenerators/SystemGenerator.Common.pdb b/Unity.Entities/SourceGenerators/SystemGenerator.Common.pdb index d9953349..24a25d1e 100644 Binary files a/Unity.Entities/SourceGenerators/SystemGenerator.Common.pdb and b/Unity.Entities/SourceGenerators/SystemGenerator.Common.pdb differ diff --git a/Unity.Entities/SourceGenerators/SystemGenerator.EntityQueryBulkOperations.dll b/Unity.Entities/SourceGenerators/SystemGenerator.EntityQueryBulkOperations.dll index 72821307..a439c0d3 100644 Binary files a/Unity.Entities/SourceGenerators/SystemGenerator.EntityQueryBulkOperations.dll and b/Unity.Entities/SourceGenerators/SystemGenerator.EntityQueryBulkOperations.dll differ diff --git a/Unity.Entities/SourceGenerators/SystemGenerator.EntityQueryBulkOperations.pdb b/Unity.Entities/SourceGenerators/SystemGenerator.EntityQueryBulkOperations.pdb index e8d18861..476230ce 100644 Binary files a/Unity.Entities/SourceGenerators/SystemGenerator.EntityQueryBulkOperations.pdb and b/Unity.Entities/SourceGenerators/SystemGenerator.EntityQueryBulkOperations.pdb differ diff --git a/Unity.Entities/SourceGenerators/SystemGenerator.LambdaJobs.dll b/Unity.Entities/SourceGenerators/SystemGenerator.LambdaJobs.dll index 60ceffe3..642fba0e 100644 Binary files a/Unity.Entities/SourceGenerators/SystemGenerator.LambdaJobs.dll and b/Unity.Entities/SourceGenerators/SystemGenerator.LambdaJobs.dll differ diff --git a/Unity.Entities/SourceGenerators/SystemGenerator.LambdaJobs.pdb b/Unity.Entities/SourceGenerators/SystemGenerator.LambdaJobs.pdb index b11af3f0..a294c80c 100644 Binary files a/Unity.Entities/SourceGenerators/SystemGenerator.LambdaJobs.pdb and b/Unity.Entities/SourceGenerators/SystemGenerator.LambdaJobs.pdb differ diff --git a/Unity.Entities/SourceGenerators/SystemGenerator.SystemAPI.Query.dll b/Unity.Entities/SourceGenerators/SystemGenerator.SystemAPI.Query.dll index 118530d5..604dd492 100644 Binary files a/Unity.Entities/SourceGenerators/SystemGenerator.SystemAPI.Query.dll and b/Unity.Entities/SourceGenerators/SystemGenerator.SystemAPI.Query.dll differ diff --git a/Unity.Entities/SourceGenerators/SystemGenerator.SystemAPI.Query.pdb b/Unity.Entities/SourceGenerators/SystemGenerator.SystemAPI.Query.pdb index 270242c7..60d85083 100644 Binary files a/Unity.Entities/SourceGenerators/SystemGenerator.SystemAPI.Query.pdb and b/Unity.Entities/SourceGenerators/SystemGenerator.SystemAPI.Query.pdb differ diff --git a/Unity.Entities/SourceGenerators/SystemGenerator.SystemAPI.QueryBuilder.dll b/Unity.Entities/SourceGenerators/SystemGenerator.SystemAPI.QueryBuilder.dll index a05fd3cf..01abdd1c 100644 Binary files a/Unity.Entities/SourceGenerators/SystemGenerator.SystemAPI.QueryBuilder.dll and b/Unity.Entities/SourceGenerators/SystemGenerator.SystemAPI.QueryBuilder.dll differ diff --git a/Unity.Entities/SourceGenerators/SystemGenerator.SystemAPI.QueryBuilder.pdb b/Unity.Entities/SourceGenerators/SystemGenerator.SystemAPI.QueryBuilder.pdb index 08544459..d2ac02e8 100644 Binary files a/Unity.Entities/SourceGenerators/SystemGenerator.SystemAPI.QueryBuilder.pdb and b/Unity.Entities/SourceGenerators/SystemGenerator.SystemAPI.QueryBuilder.pdb differ diff --git a/Unity.Entities/SourceGenerators/SystemGenerator.SystemAPI.dll b/Unity.Entities/SourceGenerators/SystemGenerator.SystemAPI.dll index cd0ee075..347be251 100644 Binary files a/Unity.Entities/SourceGenerators/SystemGenerator.SystemAPI.dll and b/Unity.Entities/SourceGenerators/SystemGenerator.SystemAPI.dll differ diff --git a/Unity.Entities/SourceGenerators/SystemGenerator.SystemAPI.pdb b/Unity.Entities/SourceGenerators/SystemGenerator.SystemAPI.pdb index 1c965f9b..89ef720f 100644 Binary files a/Unity.Entities/SourceGenerators/SystemGenerator.SystemAPI.pdb and b/Unity.Entities/SourceGenerators/SystemGenerator.SystemAPI.pdb differ diff --git a/Unity.Entities/SourceGenerators/SystemGenerator.dll b/Unity.Entities/SourceGenerators/SystemGenerator.dll index 2ef96d7b..65716db6 100644 Binary files a/Unity.Entities/SourceGenerators/SystemGenerator.dll and b/Unity.Entities/SourceGenerators/SystemGenerator.dll differ diff --git a/Unity.Entities/SourceGenerators/SystemGenerator.pdb b/Unity.Entities/SourceGenerators/SystemGenerator.pdb index 5c7e1607..3b4d01db 100644 Binary files a/Unity.Entities/SourceGenerators/SystemGenerator.pdb and b/Unity.Entities/SourceGenerators/SystemGenerator.pdb differ diff --git a/Unity.Entities/SourceGenerators/Unity.Entities.Analyzer.CodeFixes.dll b/Unity.Entities/SourceGenerators/Unity.Entities.Analyzer.CodeFixes.dll index a218e2ab..d7078f22 100644 Binary files a/Unity.Entities/SourceGenerators/Unity.Entities.Analyzer.CodeFixes.dll and b/Unity.Entities/SourceGenerators/Unity.Entities.Analyzer.CodeFixes.dll differ diff --git a/Unity.Entities/SourceGenerators/Unity.Entities.Analyzer.CodeFixes.pdb b/Unity.Entities/SourceGenerators/Unity.Entities.Analyzer.CodeFixes.pdb index df4f0311..eb6bb552 100644 Binary files a/Unity.Entities/SourceGenerators/Unity.Entities.Analyzer.CodeFixes.pdb and b/Unity.Entities/SourceGenerators/Unity.Entities.Analyzer.CodeFixes.pdb differ diff --git a/Unity.Entities/SourceGenerators/Unity.Entities.Analyzer.dll b/Unity.Entities/SourceGenerators/Unity.Entities.Analyzer.dll index 656ce624..c163b248 100644 Binary files a/Unity.Entities/SourceGenerators/Unity.Entities.Analyzer.dll and b/Unity.Entities/SourceGenerators/Unity.Entities.Analyzer.dll differ diff --git a/Unity.Entities/SourceGenerators/Unity.Entities.Analyzer.pdb b/Unity.Entities/SourceGenerators/Unity.Entities.Analyzer.pdb index 0db901fe..5858dfb6 100644 Binary files a/Unity.Entities/SourceGenerators/Unity.Entities.Analyzer.pdb and b/Unity.Entities/SourceGenerators/Unity.Entities.Analyzer.pdb differ diff --git a/Unity.Scenes.Editor.Tests/Assets/SceneWithMaterialDependency/SubScene.unity b/Unity.Scenes.Editor.Tests/Assets/SceneWithMaterialDependency/SubScene.unity index 3eb5cb71..78d36466 100644 --- a/Unity.Scenes.Editor.Tests/Assets/SceneWithMaterialDependency/SubScene.unity +++ b/Unity.Scenes.Editor.Tests/Assets/SceneWithMaterialDependency/SubScene.unity @@ -38,12 +38,11 @@ RenderSettings: m_ReflectionIntensity: 1 m_CustomReflection: {fileID: 0} m_Sun: {fileID: 0} - m_IndirectSpecularColor: {r: 0, g: 0, b: 0, a: 1} m_UseRadianceAmbientProbe: 0 --- !u!157 &3 LightmapSettings: m_ObjectHideFlags: 0 - serializedVersion: 11 + serializedVersion: 12 m_GIWorkflowMode: 1 m_GISettings: serializedVersion: 2 @@ -98,13 +97,14 @@ LightmapSettings: m_TrainingDataDestination: TrainingData m_LightProbeSampleCountMultiplier: 4 m_LightingDataAsset: {fileID: 0} - m_UseShadowmask: 1 + m_LightingSettings: {fileID: 4890085278179872738, guid: 00a1e3be8d77248bfb0ebd4477a42b82, + type: 2} --- !u!196 &4 NavMeshSettings: serializedVersion: 2 m_ObjectHideFlags: 0 m_BuildSettings: - serializedVersion: 2 + serializedVersion: 3 agentTypeID: 0 agentRadius: 0.5 agentHeight: 2 @@ -117,7 +117,9 @@ NavMeshSettings: cellSize: 0.16666667 manualTileSize: 0 tileSize: 256 - accuratePlacement: 0 + buildHeightMesh: 0 + maxJobWorkers: 0 + preserveTilesOutsideBounds: 0 debug: m_Flags: 0 m_NavMeshData: {fileID: 0} @@ -152,8 +154,8 @@ MonoBehaviour: m_EditorClassIdentifier: GameObject: {fileID: 0} Asset: {fileID: 0} - Material: {fileID: 2100000, guid: f40229054a993f149aea8b2f9012f687, type: 2} - Texture: {fileID: 0} + Material: {fileID: 0} + Texture: {fileID: 2800000, guid: d52bd2787bc5f5d408f93a562e50feed, type: 2} --- !u!4 &572202328 Transform: m_ObjectHideFlags: 0 @@ -161,10 +163,16 @@ Transform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 572202326} + serializedVersion: 2 m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 0} - m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1660057539 &9223372036854775807 +SceneRoots: + m_ObjectHideFlags: 0 + m_Roots: + - {fileID: 572202328} diff --git a/Unity.Scenes.Editor.Tests/Assets/TestMaterial.mat b/Unity.Scenes.Editor.Tests/Assets/TestMaterial.mat deleted file mode 100644 index eed7a0fc..00000000 --- a/Unity.Scenes.Editor.Tests/Assets/TestMaterial.mat +++ /dev/null @@ -1,135 +0,0 @@ -%YAML 1.1 -%TAG !u! tag:unity3d.com,2011: ---- !u!21 &2100000 -Material: - serializedVersion: 8 - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_Name: TestMaterial - m_Shader: {fileID: 4800000, guid: 933532a4fcc9baf4fa0491de14d08ed7, type: 3} - m_Parent: {fileID: 0} - m_ModifiedSerializedProperties: 0 - m_ValidKeywords: [] - m_InvalidKeywords: [] - m_LightmapFlags: 4 - m_EnableInstancingVariants: 0 - m_DoubleSidedGI: 0 - m_CustomRenderQueue: 2000 - stringTagMap: - RenderType: Opaque - disabledShaderPasses: [] - m_LockedProperties: - m_SavedProperties: - serializedVersion: 3 - m_TexEnvs: - - _BaseMap: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - _BumpMap: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - _DetailAlbedoMap: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - _DetailMask: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - _DetailNormalMap: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - _EmissionMap: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - _MainTex: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - _MetallicGlossMap: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - _OcclusionMap: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - _ParallaxMap: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - _SpecGlossMap: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - unity_Lightmaps: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - unity_LightmapsInd: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - unity_ShadowMasks: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - m_Ints: [] - m_Floats: - - _AlphaClip: 0 - - _AlphaToMask: 0 - - _Blend: 0 - - _BlendModePreserveSpecular: 1 - - _BumpScale: 1 - - _ClearCoatMask: 0 - - _ClearCoatSmoothness: 0 - - _Cull: 2 - - _Cutoff: 0.5 - - _DetailAlbedoMapScale: 1 - - _DetailNormalMapScale: 1 - - _DstBlend: 0 - - _DstBlendAlpha: 0 - - _EnvironmentReflections: 1 - - _GlossMapScale: 1 - - _Glossiness: 0.5 - - _GlossyReflections: 1 - - _Metallic: 0 - - _Mode: 0 - - _OcclusionStrength: 1 - - _Parallax: 0.02 - - _QueueOffset: 0 - - _ReceiveShadows: 1 - - _Smoothness: 0.5 - - _SmoothnessTextureChannel: 0 - - _SpecularHighlights: 1 - - _SrcBlend: 1 - - _SrcBlendAlpha: 1 - - _Surface: 0 - - _UVSec: 0 - - _WorkflowMode: 1 - - _ZWrite: 1 - m_Colors: - - _BaseColor: {r: 1, g: 0, b: 0, a: 1} - - _Color: {r: 1, g: 0, b: 0, a: 1} - - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} - - _SpecColor: {r: 0.19999996, g: 0.19999996, b: 0.19999996, a: 1} - m_BuildTextureStacks: [] ---- !u!114 &4812924117557409382 -MonoBehaviour: - m_ObjectHideFlags: 11 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 0} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3} - m_Name: - m_EditorClassIdentifier: - version: 7 diff --git a/Unity.Scenes.Editor.Tests/Assets/TestMaterial.mat.meta b/Unity.Scenes.Editor.Tests/Assets/TestMaterial.mat.meta deleted file mode 100644 index 40df66d2..00000000 --- a/Unity.Scenes.Editor.Tests/Assets/TestMaterial.mat.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: f40229054a993f149aea8b2f9012f687 -NativeFormatImporter: - externalObjects: {} - mainObjectFileID: 0 - userData: - assetBundleName: - assetBundleVariant: diff --git a/Unity.Scenes.Editor.Tests/EditorEntityScenesTests.cs b/Unity.Scenes.Editor.Tests/EditorEntityScenesTests.cs index ceaf7ae9..899a09b4 100644 --- a/Unity.Scenes.Editor.Tests/EditorEntityScenesTests.cs +++ b/Unity.Scenes.Editor.Tests/EditorEntityScenesTests.cs @@ -1,3 +1,4 @@ +using System.IO; using NUnit.Framework; using Unity.Entities.Tests; using Unity.Scenes.Editor; @@ -16,6 +17,31 @@ public class MaterialRefComponent : IComponentData public Material Value; } + Material m_TestMaterial; + public static string s_MaterialAssetPath = "Assets/TestMaterial.asset"; + + public void CreateBasicMaterial() + { +#if UNITY_EDITOR + m_TestMaterial = new Material(Shader.Find("Transparent/Diffuse")); + AssetDatabase.CreateAsset(m_TestMaterial, s_MaterialAssetPath); +#endif + } + + [SetUp] + public void setup() + { + CreateBasicMaterial(); + } + + [TearDown] + public void Tearddown() + { +#if UNITY_EDITOR + AssetDatabase.DeleteAsset(s_MaterialAssetPath); +#endif + } + [Test] public void TestReadAndWriteWithObjectRef() { @@ -24,10 +50,9 @@ public void TestReadAndWriteWithObjectRef() using var dstWorld = new World(""); var dstEntitymanager = dstWorld.EntityManager; - var material = AssetDatabase.LoadAssetAtPath("Packages/com.unity.entities/Unity.Scenes.Hybrid.Tests/Test.mat"); var entity = m_Manager.CreateEntity(); - m_Manager.AddComponentData(entity, new MaterialRefComponent { Value = material }); + m_Manager.AddComponentData(entity, new MaterialRefComponent { Value = m_TestMaterial }); m_Manager.AddComponentData(entity, new EcsTestData() { value = 5}); EditorEntityScenes.Write(m_Manager, binPath, binRefPath); @@ -35,8 +60,8 @@ public void TestReadAndWriteWithObjectRef() var dstEntity = dstEntitymanager.UniversalQuery.GetSingletonEntity(); - Assert.AreEqual(material, m_Manager.GetComponentData(entity).Value); - Assert.AreEqual(material, dstEntitymanager.GetComponentData(dstEntity).Value); + Assert.AreEqual(m_TestMaterial, m_Manager.GetComponentData(entity).Value); + Assert.AreEqual(m_TestMaterial, dstEntitymanager.GetComponentData(dstEntity).Value); Assert.AreEqual(5, m_Manager.GetComponentData(entity).value); Assert.AreEqual(5, dstEntitymanager.GetComponentData(dstEntity).value); diff --git a/Unity.Scenes.Editor.Tests/LiveConversionEditorTests.cs b/Unity.Scenes.Editor.Tests/LiveConversionEditorTests.cs index 63eb35ae..1ee35dec 100644 --- a/Unity.Scenes.Editor.Tests/LiveConversionEditorTests.cs +++ b/Unity.Scenes.Editor.Tests/LiveConversionEditorTests.cs @@ -52,13 +52,20 @@ abstract class LiveBakingAndConversionBase [SerializeField] protected string m_PrefabPath; [SerializeField] protected Material m_TestMaterial; [SerializeField] protected Texture m_TestTexture; + public static string s_MaterialAssetPath = "Assets/TestMaterial.asset"; + + public Material CreateBasicMaterial() + { + Material mat = new Material(Shader.Find("Transparent/Diffuse")); + AssetDatabase.CreateAsset(mat, s_MaterialAssetPath); + return mat; + } public void OneTimeSetUp() { if (!LiveConversionTest.OneTimeSetUp()) return; m_TestTexture = AssetDatabase.LoadAssetAtPath(AssetPath("TestTexture.asset")); - m_TestMaterial = AssetDatabase.LoadAssetAtPath(AssetPath("TestMaterial.mat")); EditorSettings.enterPlayModeOptionsEnabled = true; EditorSettings.enterPlayModeOptions = EnterPlayModeOptions.DisableDomainReload; @@ -76,6 +83,13 @@ public void OneTimeTearDown() public void SetUp() { LiveConversionTest.SetUp(); + m_TestMaterial = CreateBasicMaterial(); + } + + [TearDown] + public void TearDown() + { + AssetDatabase.DeleteAsset(s_MaterialAssetPath); } static string AssetPath(string name) => "Packages/com.unity.entities/Unity.Scenes.Editor.Tests/Assets/" + name; @@ -1027,7 +1041,7 @@ public enum ChangeMode [UnityTest, EmbeddedPackageOnlyTest] public IEnumerator LiveConversion_WithMaterialDependency_ChangeCausesReconversion([Values] Mode mode, [Values]ChangeMode change) { - m_TestMaterial.SetColor("_BaseColor", Color.white); + m_TestMaterial.SetColor("_Color", Color.white); AssetDatabase.SaveAssetIfDirty(m_TestMaterial); AssetDatabase.Refresh(); @@ -1038,7 +1052,7 @@ public IEnumerator LiveConversion_WithMaterialDependency_ChangeCausesReconversio yield return GetEnterPlayMode(mode); - Assert.AreEqual(Color.white, m_TestMaterial.GetColor("_BaseColor"), "The Material color was supposed to be initialized with white. This is likely a bug in the test or Unity itself, not in the actual code being tested."); + Assert.AreEqual(Color.white, m_TestMaterial.GetColor("_Color"), "The Material color was supposed to be initialized with white. This is likely a bug in the test or Unity itself, not in the actual code being tested."); { var w = GetLiveConversionWorld(mode); @@ -1053,7 +1067,7 @@ public IEnumerator LiveConversion_WithMaterialDependency_ChangeCausesReconversio var materialPath = AssetDatabase.GetAssetPath(m_TestMaterial); var text = File.ReadAllText(materialPath); - string replaced = text.Replace("_BaseColor: {r: 1, g: 1, b: 1, a: 1}", "_BaseColor: {r: 0, g: 0, b: 0.5, a: 1}"); + string replaced = text.Replace("_Color: {r: 1, g: 1, b: 1, a: 1}", "_Color: {r: 0, g: 0, b: 0.5, a: 1}"); Assert.AreNotEqual(replaced, text, "Replacing the contents of the yaml file using string search failed."); File.WriteAllText(materialPath, replaced); @@ -1062,18 +1076,18 @@ public IEnumerator LiveConversion_WithMaterialDependency_ChangeCausesReconversio else if (change == ChangeMode.ChangeInMemory) { Undo.RegisterCompleteObjectUndo(m_TestMaterial, "undo"); - m_TestMaterial.SetColor("_BaseColor", newColor); + m_TestMaterial.SetColor("_Color", newColor); } else if (change == ChangeMode.ChangeAndWrite) { - m_TestMaterial.SetColor("_BaseColor", newColor); + m_TestMaterial.SetColor("_Color", newColor); AssetDatabase.SaveAssets(); } yield return UpdateEditorAndWorld(w); Assert.AreEqual(1, testQuery.CalculateEntityCount(), "Expected a game object to be converted"); - Assert.AreEqual(newColor, m_TestMaterial.GetColor("_BaseColor"), + Assert.AreEqual(newColor, m_TestMaterial.GetColor("_Color"), "The color of the material hasn't changed to the expected value. This is likely a bug in the test or Unity itself, not in the actual code being tested."); Assert.AreEqual(newColor, testQuery.GetSingleton().MaterialColor, "The game object with the asset dependency has not been reconverted"); @@ -3718,7 +3732,7 @@ class LiveLinkBakingEditorTests : LiveBakingAndConversionBase } [TearDown] - public void TearDown() + public void Teardown() { //base.TearDown(); LiveConversionSettings.AdditionalConversionSystems.Clear(); @@ -7747,7 +7761,7 @@ public IEnumerator IncrementalBaking_PreprocessPosprocessConsistency_NoBakersRun Mode mode = Mode.Edit; using var baking = new BakerDataUtility.OverrideBakers(true, typeof(TestAdditionalEntityComponentAuthoring.Baker), typeof(LinkedEntityGroupAuthoringBaker)); - var originalColor = m_TestMaterial.GetColor("_BaseColor"); + var originalColor = m_TestMaterial.GetColor("_Color"); List goList = new List(); GameObject root = null; @@ -7777,7 +7791,7 @@ public IEnumerator IncrementalBaking_PreprocessPosprocessConsistency_NoBakersRun // We force the asset database to change the version, but with an asset that will not trigger any baker // This will check that Preprocess and Postprocess run consistently, even if no baker runs - m_TestMaterial.SetColor("_BaseColor", modifiedColor); + m_TestMaterial.SetColor("_Color", modifiedColor); AssetDatabase.SaveAssetIfDirty(m_TestMaterial); AssetDatabase.Refresh(); @@ -7785,7 +7799,7 @@ public IEnumerator IncrementalBaking_PreprocessPosprocessConsistency_NoBakersRun } // Restore original color - m_TestMaterial.SetColor("_BaseColor", Color.white); + m_TestMaterial.SetColor("_Color", Color.white); AssetDatabase.SaveAssetIfDirty(m_TestMaterial); } diff --git a/Unity.Scenes.Editor/SubSceneContextMenu.cs b/Unity.Scenes.Editor/SubSceneContextMenu.cs index fa4b5f24..bbb0a662 100644 --- a/Unity.Scenes.Editor/SubSceneContextMenu.cs +++ b/Unity.Scenes.Editor/SubSceneContextMenu.cs @@ -124,7 +124,7 @@ internal static void AddExtraSceneHeaderContextMenuItems(GenericMenu menu, Scene { menu.AddSeparator(""); var newEmptySubScene = EditorGUIUtility.TrTextContent("New Empty Sub Scene..."); - var validTarget = target.isLoaded; + var validTarget = target.isLoaded && !string.IsNullOrEmpty(target.path); if (!EditorApplication.isPlaying && validTarget) menu.AddItem(newEmptySubScene, false, OnMenuItemForNewSubScene, new NewSubSceneArgs(null, target, NewSubSceneMode.EmptyScene, k_DefaultFilename)); else diff --git a/Unity.Scenes.Hybrid.Tests/Editmode/CompanionComponentEditorTests.cs b/Unity.Scenes.Hybrid.Tests/Editmode/CompanionComponentEditorTests.cs index 5b365517..b6673351 100644 --- a/Unity.Scenes.Hybrid.Tests/Editmode/CompanionComponentEditorTests.cs +++ b/Unity.Scenes.Hybrid.Tests/Editmode/CompanionComponentEditorTests.cs @@ -227,4 +227,4 @@ public IEnumerator CompanionComponent_SceneCulling([Values]bool sceneViewShowRun } } -#endif +#endif \ No newline at end of file diff --git a/Unity.Scenes.Hybrid.Tests/Editmode/Content/RuntimeContentManagerTests.cs b/Unity.Scenes.Hybrid.Tests/Editmode/Content/RuntimeContentManagerTests.cs index cc94cc4f..6a08ba8b 100644 --- a/Unity.Scenes.Hybrid.Tests/Editmode/Content/RuntimeContentManagerTests.cs +++ b/Unity.Scenes.Hybrid.Tests/Editmode/Content/RuntimeContentManagerTests.cs @@ -508,4 +508,4 @@ public void WeakObjectReference_IsReferenceValid_ReturnsFalse_When_Asset_DoesntE #endif } } -#endif +#endif \ No newline at end of file diff --git a/Unity.Scenes.Hybrid.Tests/Editmode/SharedComponentSerializeTests.cs b/Unity.Scenes.Hybrid.Tests/Editmode/SharedComponentSerializeTests.cs index 46abe81a..dcbc2ea4 100644 --- a/Unity.Scenes.Hybrid.Tests/Editmode/SharedComponentSerializeTests.cs +++ b/Unity.Scenes.Hybrid.Tests/Editmode/SharedComponentSerializeTests.cs @@ -74,9 +74,29 @@ public override int GetHashCode() } } + public static string s_MaterialAssetPath = "Assets/TestMaterial.asset"; + public Material CreateBasicMaterial() + { +#if UNITY_EDITOR + Material mat = new Material(Shader.Find("Transparent/Diffuse")); + AssetDatabase.CreateAsset(mat, s_MaterialAssetPath); + return mat; +#else + return null; +#endif + } + + [TearDown] + public void Tearddown() + { +#if UNITY_EDITOR + AssetDatabase.DeleteAsset(s_MaterialAssetPath); +#endif + } + TestStruct ConfigureStruct() { - var material = AssetDatabase.LoadAssetAtPath("Packages/com.unity.entities/Unity.Scenes.Hybrid.Tests/Test.mat"); + var material = CreateBasicMaterial(); var srcData = new TestStruct(); srcData.Value = 5; srcData.EnumValue = MyEnum.Blah; diff --git a/Unity.Scenes.Hybrid.Tests/Playmode/AuthoringWithMaterial.cs b/Unity.Scenes.Hybrid.Tests/Playmode/AuthoringWithMaterial.cs index e7adb555..37b760b7 100644 --- a/Unity.Scenes.Hybrid.Tests/Playmode/AuthoringWithMaterial.cs +++ b/Unity.Scenes.Hybrid.Tests/Playmode/AuthoringWithMaterial.cs @@ -1,6 +1,6 @@ using System; using Unity.Entities; -using Unity.Scenes.Hybrid.Tests; +using Unity.Scenes.Hybrid.Tests.Playmode; using UnityEngine; namespace Unity.Scenes.Hybrid.Tests @@ -43,7 +43,8 @@ public override void Bake(AuthoringWithMaterial authoring) { // This test shouldn't require transform components var entity = GetEntity(TransformUsageFlags.None); - AddSharedComponentManaged(entity, new SharedWithMaterial(){material = authoring.material}); + // The material asset must be created before on the main thread not at import time + AddSharedComponentManaged(entity, new SharedWithMaterial(){material = SubSceneTests.GetBasicMaterial()}); AddComponent(entity); // Add a non-enableable tag we can search for as a singleton AddComponent(entity); diff --git a/Unity.Scenes.Hybrid.Tests/Playmode/SubSceneTestFixture.cs b/Unity.Scenes.Hybrid.Tests/Playmode/SubSceneTestFixture.cs index 3c20eb27..78217c17 100644 --- a/Unity.Scenes.Hybrid.Tests/Playmode/SubSceneTestFixture.cs +++ b/Unity.Scenes.Hybrid.Tests/Playmode/SubSceneTestFixture.cs @@ -2,6 +2,7 @@ using System.Linq; using NUnit.Framework; using Unity.Entities; +using UnityEngine; using UnityEngine.TestTools; #if UNITY_EDITOR using UnityEditor; @@ -46,8 +47,26 @@ public Hash128 BuildSceneGUID GUID m_DotsSettingsGUID; List m_SceneWithBuildSettingsPaths = new(); static string m_TempPath = "Assets/Temp"; + public static string s_MaterialAssetPath = "Assets/TestMaterial.asset"; #endif + static void CreateBasicMaterial() + { +#if UNITY_EDITOR + var material = new Material(Shader.Find("Transparent/Diffuse")); + AssetDatabase.CreateAsset(material, s_MaterialAssetPath); +#endif + } + + public static Material GetBasicMaterial() + { +#if UNITY_EDITOR + return AssetDatabase.LoadAssetAtPath(s_MaterialAssetPath); +#else + return null; +#endif + } + public static World CreateEntityWorld(string name) { var systems = DefaultWorldInitialization.GetAllSystems(WorldSystemFilterFlags.Default, true); @@ -116,6 +135,8 @@ public void Setup() List newEditorSceneList = EditorBuildSettings.scenes.ToList(); newEditorSceneList.Add(settingsScene); EditorBuildSettings.scenes = newEditorSceneList.ToArray(); + + CreateBasicMaterial(); } //IPostBuildCleanup.Cleanup @@ -130,6 +151,8 @@ public void Cleanup() if (!EditorApplication.isPlaying) EditorSceneManager.NewScene(NewSceneSetup.EmptyScene); + + AssetDatabase.DeleteAsset(s_MaterialAssetPath); } #endif } diff --git a/Unity.Scenes.Hybrid.Tests/Playmode/SubSceneTests.cs b/Unity.Scenes.Hybrid.Tests/Playmode/SubSceneTests.cs index fc5434f8..ae57f97f 100644 --- a/Unity.Scenes.Hybrid.Tests/Playmode/SubSceneTests.cs +++ b/Unity.Scenes.Hybrid.Tests/Playmode/SubSceneTests.cs @@ -565,4 +565,4 @@ public void OnUpdate(ref SystemState state) } } } -} +} \ No newline at end of file diff --git a/Unity.Scenes.Hybrid.Tests/Test.mat b/Unity.Scenes.Hybrid.Tests/Test.mat deleted file mode 100644 index 7ff25f53..00000000 --- a/Unity.Scenes.Hybrid.Tests/Test.mat +++ /dev/null @@ -1,135 +0,0 @@ -%YAML 1.1 -%TAG !u! tag:unity3d.com,2011: ---- !u!114 &-1974377563364191069 -MonoBehaviour: - m_ObjectHideFlags: 11 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 0} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3} - m_Name: - m_EditorClassIdentifier: - version: 7 ---- !u!21 &2100000 -Material: - serializedVersion: 8 - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_Name: Test - m_Shader: {fileID: 4800000, guid: 933532a4fcc9baf4fa0491de14d08ed7, type: 3} - m_Parent: {fileID: 0} - m_ModifiedSerializedProperties: 0 - m_ValidKeywords: [] - m_InvalidKeywords: [] - m_LightmapFlags: 4 - m_EnableInstancingVariants: 0 - m_DoubleSidedGI: 0 - m_CustomRenderQueue: 2000 - stringTagMap: - RenderType: Opaque - disabledShaderPasses: [] - m_LockedProperties: - m_SavedProperties: - serializedVersion: 3 - m_TexEnvs: - - _BaseMap: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - _BumpMap: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - _DetailAlbedoMap: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - _DetailMask: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - _DetailNormalMap: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - _EmissionMap: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - _MainTex: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - _MetallicGlossMap: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - _OcclusionMap: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - _ParallaxMap: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - _SpecGlossMap: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - unity_Lightmaps: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - unity_LightmapsInd: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - unity_ShadowMasks: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - m_Ints: [] - m_Floats: - - _AlphaClip: 0 - - _AlphaToMask: 0 - - _Blend: 0 - - _BlendModePreserveSpecular: 1 - - _BumpScale: 1 - - _ClearCoatMask: 0 - - _ClearCoatSmoothness: 0 - - _Cull: 2 - - _Cutoff: 0.5 - - _DetailAlbedoMapScale: 1 - - _DetailNormalMapScale: 1 - - _DstBlend: 0 - - _DstBlendAlpha: 0 - - _EnvironmentReflections: 1 - - _GlossMapScale: 1 - - _Glossiness: 0.5 - - _GlossyReflections: 1 - - _Metallic: 0 - - _Mode: 0 - - _OcclusionStrength: 1 - - _Parallax: 0.02 - - _QueueOffset: 0 - - _ReceiveShadows: 1 - - _Smoothness: 0.5 - - _SmoothnessTextureChannel: 0 - - _SpecularHighlights: 1 - - _SrcBlend: 1 - - _SrcBlendAlpha: 1 - - _Surface: 0 - - _UVSec: 0 - - _WorkflowMode: 1 - - _ZWrite: 1 - m_Colors: - - _BaseColor: {r: 0.66624755, g: 0.54245275, b: 1, a: 1} - - _Color: {r: 0.66624755, g: 0.54245263, b: 1, a: 1} - - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} - - _SpecColor: {r: 0.19999996, g: 0.19999996, b: 0.19999996, a: 1} - m_BuildTextureStacks: [] diff --git a/Unity.Scenes.Hybrid.Tests/Test.mat.meta b/Unity.Scenes.Hybrid.Tests/Test.mat.meta deleted file mode 100644 index 2f3d3855..00000000 --- a/Unity.Scenes.Hybrid.Tests/Test.mat.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: edb5bfe54738c4e58941b910ae835274 -NativeFormatImporter: - externalObjects: {} - mainObjectFileID: 2100000 - userData: - assetBundleName: - assetBundleVariant: diff --git a/Unity.Scenes.Hybrid.Tests/TestSceneWithSubScene/Subscene/TestSubScene.unity b/Unity.Scenes.Hybrid.Tests/TestSceneWithSubScene/Subscene/TestSubScene.unity index 7e5ee8ec..0ee0be3f 100644 --- a/Unity.Scenes.Hybrid.Tests/TestSceneWithSubScene/Subscene/TestSubScene.unity +++ b/Unity.Scenes.Hybrid.Tests/TestSceneWithSubScene/Subscene/TestSubScene.unity @@ -38,12 +38,11 @@ RenderSettings: m_ReflectionIntensity: 1 m_CustomReflection: {fileID: 0} m_Sun: {fileID: 0} - m_IndirectSpecularColor: {r: 0, g: 0, b: 0, a: 1} m_UseRadianceAmbientProbe: 0 --- !u!157 &3 LightmapSettings: m_ObjectHideFlags: 0 - serializedVersion: 11 + serializedVersion: 12 m_GIWorkflowMode: 1 m_GISettings: serializedVersion: 2 @@ -98,13 +97,14 @@ LightmapSettings: m_TrainingDataDestination: TrainingData m_LightProbeSampleCountMultiplier: 4 m_LightingDataAsset: {fileID: 0} - m_UseShadowmask: 1 + m_LightingSettings: {fileID: 4890085278179872738, guid: 3d649c70bd3f7411ba7ebfdb49095708, + type: 2} --- !u!196 &4 NavMeshSettings: serializedVersion: 2 m_ObjectHideFlags: 0 m_BuildSettings: - serializedVersion: 2 + serializedVersion: 3 agentTypeID: 0 agentRadius: 0.5 agentHeight: 2 @@ -117,7 +117,9 @@ NavMeshSettings: cellSize: 0.16666667 manualTileSize: 0 tileSize: 256 - accuratePlacement: 0 + buildHeightMesh: 0 + maxJobWorkers: 0 + preserveTilesOutsideBounds: 0 debug: m_Flags: 0 m_NavMeshData: {fileID: 0} @@ -150,7 +152,7 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: ba581c640bbca683abfea52e25afa2d3, type: 3} m_Name: m_EditorClassIdentifier: - material: {fileID: 2100000, guid: edb5bfe54738c4e58941b910ae835274, type: 2} + material: {fileID: 2100000, guid: 502c68c0679c64afe9aa40833d92fdfd, type: 2} --- !u!4 &1655633439 Transform: m_ObjectHideFlags: 0 @@ -158,10 +160,16 @@ Transform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1655633437} + serializedVersion: 2 m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 0, y: 0.19, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 0} - m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1660057539 &9223372036854775807 +SceneRoots: + m_ObjectHideFlags: 0 + m_Roots: + - {fileID: 1655633439} diff --git a/ValidationExceptions.json b/ValidationExceptions.json index adfb612d..08d3d1cf 100644 --- a/ValidationExceptions.json +++ b/ValidationExceptions.json @@ -1,20 +1,25 @@ { "ErrorExceptions": [ - { - "ValidationTest": "API Validation", - "ExceptionMessage": "Additions require a new minor or major version.", - "PackageVersion": "1.3.5" - }, - { - "ValidationTest": "API Validation", - "ExceptionMessage": "New assembly \"Unity.Entities.TestComponents\" may only be added in a new minor or major version.", - "PackageVersion": "1.3.5" - }, - { - "ValidationTest": "API Validation", - "ExceptionMessage": "New assembly \"Unity.Scenes.PerformanceTests\" may only be added in a new minor or major version.", - "PackageVersion": "1.3.5" - } + { + "ValidationTest": "API Validation", + "ExceptionMessage": "Breaking changes require a new major version.", + "PackageVersion": "1.3.8" + }, + { + "ValidationTest": "API Validation", + "ExceptionMessage": "Additions require a new minor or major version.", + "PackageVersion": "1.3.8" + }, + { + "ValidationTest": "API Validation", + "ExceptionMessage": "New assembly \"Unity.Entities.TestComponents\" may only be added in a new minor or major version.", + "PackageVersion": "1.3.8" + }, + { + "ValidationTest": "API Validation", + "ExceptionMessage": "New assembly \"Unity.Scenes.PerformanceTests\" may only be added in a new minor or major version.", + "PackageVersion": "1.3.8" + } ], "WarningExceptions": [] } diff --git a/package.json b/package.json index 57538797..00d1addd 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "com.unity.entities", "displayName": "Entities", - "version": "1.3.5", + "version": "1.3.8", "unity": "2022.3", "unityRelease": "11f1", "dependencies": { @@ -27,15 +27,15 @@ "unity" ], "_upm": { - "changelog": "### Changed\n\n* Local optimization in EntityManager.CopyEntitiesFrom\n* Updated Mathematics dependency to version 1.3.2\n* Updated Burst dependency to version 1.8.18\n\n### Fixed\n\n* Fixed misleading documentation for Baker.IsActiveAndEnabled\n* Improved build determinism by sorting inputs to build methods.\n* Exception thrown under certain circumstances when a system was destroyed could break various DOTS editor windows." + "changelog": "### Removed\n\n* removing various material assets within entities (Test.mat and TestMaterial.mat).\n\n### Fixed\n\n* Disable \"new empty subscene\" menu item on default untitled scene.\n* Fix invalid queries generated for `IJobEntity` with `[WithPresent(typeof(T))]` and `EnabledRef` and/or `in T` in the same job." }, "upmCi": { - "footprint": "955b6ef8047de4afc228e9e8ced425a03d96940d" + "footprint": "625b7430bb260dfcd202a110b278aaabe4689c15" }, "documentationUrl": "https://docs.unity3d.com/Packages/com.unity.entities@1.3/manual/index.html", "repository": { "url": "https://github.cds.internal.unity3d.com/unity/dots.git", "type": "git", - "revision": "f9f023a1661a1a7a17264c9907b75c9b46434416" + "revision": "3ea543f9dd8be902be20c6f04e900cb913436f36" } }