I was using Entities version: 0.1.1-preview and now I am trying to upgrade to the latest version. I am also trying to remove the now obsolete code, but I am running into an issue with GameObjectConversionSettings.FromWorld. I tried to look at other post, but no of those solutions are working properly.
The main issue is how to deal with the BlobAssetStore. I tried to pass null, however; I receive a ArgumentNullException.
ArgumentNullException: A valid BlobAssetStore must be passed to construct a BlobAssetComputationContext
Parameter name: blobAssetStore
Unity.Entities.BlobAssetComputationContext`2[TS,TB]..ctor (Unity.Entities.BlobAssetStore blobAssetStore, System.Int32 initialCapacity, Unity.Collections.Allocator allocator) (at Library/PackageCache/com.unity.entities@0.4.0-preview.10/Unity.Entities.Hybrid/GameObjectConversion/BlobAssetComputationContext.cs:31)
Unity.Physics.Authoring.BeginColliderConversionSystem.OnUpdate () (at Library/PackageCache/com.unity.physics@0.2.5-preview.1/Unity.Physics.Hybrid/Conversion/BeginColliderConversionSystem.cs:20)
Unity.Entities.ComponentSystem.Update () (at Library/PackageCache/com.unity.entities@0.4.0-preview.10/Unity.Entities/ComponentSystem.cs:107)
Unity.Entities.ComponentSystemGroup.UpdateAllSystems () (at Library/PackageCache/com.unity.entities@0.4.0-preview.10/Unity.Entities/ComponentSystemGroup.cs:182)
UnityEngine.DebugLogHandler:LogException(Exception, Object)
Unity.Entities.Conversion.JournalingUnityLogger:LogException(Exception, Object) (at Library/PackageCache/com.unity.entities@0.4.0-preview.10/Unity.Entities.Hybrid/GameObjectConversion/JournalingUnityLogger.cs:50)
UnityEngine.Debug:LogException(Exception)
Unity.Debug:LogException(Exception) (at Library/PackageCache/com.unity.entities@0.4.0-preview.10/Unity.Entities/Stubs/Unity/Debug.cs:19)
Unity.Entities.ComponentSystemGroup:UpdateAllSystems() (at Library/PackageCache/com.unity.entities@0.4.0-preview.10/Unity.Entities/ComponentSystemGroup.cs:186)
Unity.Entities.ComponentSystemGroup:OnUpdate() (at Library/PackageCache/com.unity.entities@0.4.0-preview.10/Unity.Entities/ComponentSystemGroup.cs:169)
Unity.Entities.ComponentSystem:Update() (at Library/PackageCache/com.unity.entities@0.4.0-preview.10/Unity.Entities/ComponentSystem.cs:107)
Unity.Entities.GameObjectConversionUtility:Convert(World) (at Library/PackageCache/com.unity.entities@0.4.0-preview.10/Unity.Entities.Hybrid/GameObjectConversion/GameObjectConversionUtility.cs:147)
Unity.Entities.GameObjectConversionUtility:ConvertGameObjectHierarchy(GameObject, GameObjectConversionSettings) (at Library/PackageCache/com.unity.entities@0.4.0-preview.10/Unity.Entities.Hybrid/GameObjectConversion/GameObjectConversionUtility.cs:229)
Source.Runtime.Game.GameLogic.<Start>d__6:MoveNext() (at Assets/Source/Runtime/Game/GameLogic/System/GameplayStartup.cs:51)
UnityEngine.UnitySynchronizationContext:ExecuteTasks()
I then passed new BlobAssetStore(), this generates a different error:
A Native Collection has not been disposed, resulting in a memory leak. Allocated from:
Unity.Entities.BlobAssetStore:.ctor() (at Library\PackageCache\com.unity.entities@0.4.0-preview.10\Unity.Entities.Hybrid\GameObjectConversion\BlobAssetStore.cs:23)
Source.Runtime.Game.GameLogic.<Start>d__6:MoveNext() (at Assets\Source\Runtime\Game\GameLogic\System\GameplayStartup.cs:48)
System.Runtime.CompilerServices.MoveNextRunner:InvokeMoveNext(Object)
System.Threading.ExecutionContext:RunInternal(ExecutionContext, ContextCallback, Object, Boolean)
System.Threading.ExecutionContext:Run(ExecutionContext, ContextCallback, Object, Boolean)
System.Runtime.CompilerServices.MoveNextRunner:Run()
System.Threading.Tasks.<>c:<.cctor>b__7_0(Object)
UnityEngine.WorkRequest:Invoke()
UnityEngine.UnitySynchronizationContext:Exec()
UnityEngine.UnitySynchronizationContext:ExecuteTasks()
I had a grand idea of disposing of the blob store, don’t do that. It will crash Unity.
If I ignore the Native Collection memory leak error, everything seems fine. I just don’t want to check in code that already generates errors. Any ideas?
Packages I’m using:
Entities: preview -10 0.4.0
Hybrid Renderer: preview.10 0.3.1
Unity Physics: preview-1 0.2.5