I’m getting a weird error when i try to use generics with IJobProcessComponentData or IJobProcessComponentDataWithEntity i can use generics on other types of jobs but not this ones.
I get ArgumentNullException: String reference not set to an instance of a String. as soon as i run the scene. I don’t even have to use that specific job just nee to have it on a system.
Here is an example of a problematic job.
[BurstCompile]
struct SampleJob02<T> : IJobProcessComponentData<T, Position> where T : struct, IComponentData {
public void Execute(ref T data0, ref Position data1) {
// *******************************
// Apply some transformations here
// *******************************
}
}
Bellow is the full stack of the error
Error stack
ArgumentNullException: String reference not set to an instance of a String.
Parameter name: s
System.Text.Encoding.GetBytes (System.String s) (at :0)
Unity.Entities.TypeManager.CalculateMemoryOrdering (System.Type type) (at Library/PackageCache/com.unity.entities@0.0.12-preview.21/Unity.Entities/Types/TypeManager.cs:178)
Unity.Entities.TypeManager.BuildComponentType (System.Type type) (at Library/PackageCache/com.unity.entities@0.0.12-preview.21/Unity.Entities/Types/TypeManager.cs:206)
Unity.Entities.TypeManager.CreateTypeIndexThreadSafe (System.Type type) (at Library/PackageCache/com.unity.entities@0.0.12-preview.21/Unity.Entities/Types/TypeManager.cs:159)
Unity.Entities.TypeManager.GetTypeIndex (System.Type type) (at Library/PackageCache/com.unity.entities@0.0.12-preview.21/Unity.Entities/Types/TypeManager.cs:122)
Unity.Entities.ComponentType…ctor (System.Type type, Unity.Entities.ComponentType+AccessMode accessModeType) (at Library/PackageCache/com.unity.entities@0.0.12-preview.21/Unity.Entities/Types/ComponentType.cs:73)
Unity.Entities.IJobProcessComponentDataUtility.GetComponentTypes (System.Type jobType, System.Type interfaceType, System.Int32& processCount, Unity.Entities.ComponentType[ ]& changedFilter) (at Library/PackageCache/com.unity.entities@0.0.12-preview.21/Unity.Entities/IJobProcessComponentData.cs:244)
Unity.Entities.IJobProcessComponentDataUtility.GetComponentTypes (System.Type jobType) (at Library/PackageCache/com.unity.entities@0.0.12-preview.21/Unity.Entities/IJobProcessComponentData.cs:219)
Unity.Entities.JobProcessComponentDataExtensions.GetComponentGroupForIJobProcessComponentData (Unity.Entities.ComponentSystemBase system, System.Type jobType) (at Library/PackageCache/com.unity.entities@0.0.12-preview.21/Unity.Entities/IJobProcessComponentData.cs:397)
Unity.Entities.ComponentSystemBase.InjectNestedIJobProcessComponentDataJobs () (at Library/PackageCache/com.unity.entities@0.0.12-preview.21/Unity.Entities/ComponentSystem.cs:113)
Unity.Entities.ComponentSystemBase.OnBeforeCreateManagerInternal (Unity.Entities.World world) (at Library/PackageCache/com.unity.entities@0.0.12-preview.21/Unity.Entities/ComponentSystem.cs:104)
Unity.Entities.JobComponentSystem.OnBeforeCreateManagerInternal (Unity.Entities.World world) (at Library/PackageCache/com.unity.entities@0.0.12-preview.21/Unity.Entities/ComponentSystem.cs:522)
Unity.Entities.ScriptBehaviourManager.CreateInstance (Unity.Entities.World world) (at Library/PackageCache/com.unity.entities@0.0.12-preview.21/Unity.Entities/ScriptBehaviourManager.cs:21)
Unity.Entities.World.CreateManagerInternal (System.Type type, System.Object[ ] constructorArguments) (at Library/PackageCache/com.unity.entities@0.0.12-preview.21/Unity.Entities/Injection/World.cs:137)
Unity.Entities.World.GetOrCreateManagerInternal (System.Type type) (at Library/PackageCache/com.unity.entities@0.0.12-preview.21/Unity.Entities/Injection/World.cs:165)
Unity.Entities.World.GetOrCreateManager (System.Type type) (at Library/PackageCache/com.unity.entities@0.0.12-preview.21/Unity.Entities/Injection/World.cs:218)
Unity.Entities.DefaultWorldInitialization.GetBehaviourManagerAndLogException (Unity.Entities.World world, System.Type type) (at Library/PackageCache/com.unity.entities@0.0.12-preview.21/Unity.Entities.Hybrid/Injection/DefaultWorldInitialization.cs:21)
UnityEngine.Debug:LogException(Exception)
Unity.Debug:LogException(Exception) (at Library/PackageCache/com.unity.entities@0.0.12-preview.21/Unity.Entities/Stubs/Unity/Debug.cs:25)
Unity.Entities.DefaultWorldInitialization:GetBehaviourManagerAndLogException(World, Type) (at Library/PackageCache/com.unity.entities@0.0.12-preview.21/Unity.Entities.Hybrid/Injection/DefaultWorldInitialization.cs:25)
Unity.Entities.DefaultWorldInitialization:CreateBehaviourManagersForMatchingTypes(Boolean, IEnumerable`1, World) (at Library/PackageCache/com.unity.entities@0.0.12-preview.21/Unity.Entities.Hybrid/Injection/DefaultWorldInitialization.cs:75)
Unity.Entities.DefaultWorldInitialization:Initialize(String, Boolean) (at Library/PackageCache/com.unity.entities@0.0.12-preview.21/Unity.Entities.Hybrid/Injection/DefaultWorldInitialization.cs:57)
Unity.Entities.AutomaticWorldBootstrap:Initialize() (at Library/PackageCache/com.unity.entities@0.0.12-preview.21/Unity.Entities.Hybrid/Injection/AutomaticWorldBootstrap.cs:11)
Is this a bug?
I’m using Unity 2018.3.0f2 with Entities package preview 21
Thank you