Open PitouGames opened 1 year ago
Hello. The #if UNITY_EDITOR ... #endif
is being too all-encompassing in the Authoring scripts causing the build issue. To solve it, limit the scope to only the BoidAuthoring
, BoidObstacleAuthoring
, BoidSchoolAuthoring
, BoidTargetAuthoring
and TransformRecorderAuthoring
or extract the struct in a dedicated C# file.
In addition, I found it particularly intriguing to put the structure after its authoring.
Here is a patch for a temporary fix. You can apply it within your project using git apply BuildBoids.patch
.
Note that I have switched the structure to be on top for more personal clarity.
BuildBoids.patch
I have errors when building the boids project for Windows. I'm using Unity 2022.2.1f1 and made no script modification. Juste open the projet, add the "Boids" scene to build settings and build.
Errors:
Assets\Scripts\Systems\BoidSchoolSpawnSystem.cs(13,5): error SGICE002: This error indicates a bug in the DOTS source generators.
Assets\Scripts\Systems\BoidSchoolSpawnSystem.cs(13,5): error SGICE002: This error indicates a bug in the DOTS source generators. We'd appreciate a bug report (Help -> Report a Bug...). Thanks! Error message: 'System.AggregateException: One or more errors occurred. (Object reference not set to an instance of an object.) |--| ---> System.NullReferenceException: Object reference not set to an instance of an object. |--| at Unity.Entities.SourceGen.Common.SymbolExtensions.ToFullName(ITypeSymbol symbol) |--| at Unity.Entities.SourceGen.SystemAPIQueryBuilder.SystemAPIQueryBuilderDescription.<>c.<.ctor>b__18_1(Query t) |--| at System.Linq.Enumerable.SelectArrayIterator`2.MoveNext() |--| at System.Linq.Enumerable.WhereEnumerableIterator`1.MoveNext() |--| at System.String.Join(String separator, IEnumerable`1 values) |--| at Unity.Entities.SourceGen.Common.EnumerableHelpers.SeparateByCommaAndSpace(IEnumerable`1 lines) |--| at Unity.Entities.SourceGen.SystemAPIQueryBuilder.SystemAPIQueryBuilderDescription..ctor(SystemDescription systemDescription, QueryCandidate queryCandidate) |--| at Unity.Entities.SourceGen.SystemAPIQueryBuilder.SystemAPIQueryBuilderModule.RegisterChangesInSystem(SystemDescription systemDescription) |--| at Unity.Entities.SourceGen.SystemGenerator.SystemGenerator.<>c__DisplayClass2_1.Assets\Scripts\Systems\SampledAnimationClipPlaybackSystem.cs(34,66): error CS0246: The type or namespace name 'SampledAnimationClip' could not be found (are you missing a using directive or an assembly reference?)
Assets\Scripts\Systems\SampledAnimationClipPlaybackSystem.cs(55,37): error CS0246: The type or namespace name 'SampledAnimationClip' could not be found (are you missing a using directive or an assembly reference?)
Assets\Scripts\Systems\BoidSystem.cs(331,20): error CS0246: The type or namespace name 'Boid' could not be found (are you missing a using directive or an assembly reference?)
Playing in the editor has no problem.