Following code crashes unity because of invalid code gen in EntityQueryDesc.
Are generic types not supported anymore?
using Unity.Entities;
using Unity.Jobs;
[assembly: RegisterGenericComponentType(typeof(Timer<ECS_Test>))]
public struct Timer<T> : IComponentData
{
public float CurrentTime;
public float MaxTime;
public bool IsFinished { get { return CurrentTime >= MaxTime; } }
}
public struct ECS_Test : IComponentData
{
}
[AlwaysSynchronizeSystem]
public partial class SomeSystem : JobComponentSystem
{
protected override JobHandle OnUpdate(JobHandle inputDeps)
{
Entities
.WithName("GenericJob")
.WithoutBurst()
.ForEach((
ref Timer<ECS_Test> testTimer
) =>
{
testTimer.CurrentTime += 1;
}).Run();
return inputDeps;
}
}