None of these works:
// commandBuffer is a EntityCommandBuffer
this.commandBuffer.RemoveComponent<Changed>(this.entities[i]);
// or
this.commandBuffer.RemoveComponent(this.entities[i], ComponentType.Create<Changed>());
I get the following error (Just the first one. There are lots of errors after this.):
C:\Users\Marnel\AppData\Local\Unity\cache\packages\staging-packages.unity.com\com.unity.entities@0.0.12-preview.16\Unity.Entities\Types\TypeManager.cs(110,13): error: Loading from a static field System.Int32 Unity.Entities.TypeManager/StaticTypeLookup
1::typeIndex` is not supported by burst
While processing function Unity.Entities.TypeManager, Unity.Entities, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null::GetTypeIndex
1[CommonEcs.Changed, Assembly-CSharp, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null]`
While compiling job: System.Void Unity.Jobs.IJobExtensions/JobStruct`1<CommonEcs.IdentifySpriteManagerChangedValuesSystem/Job>::Execute(T&,System.IntPtr,System.IntPtr,Unity.Jobs.LowLevel.Unsafe.JobRanges&,System.Int32)
Compiler exception: System.NotSupportedException: Loading from a static field System.Int32 Unity.Entities.TypeManager/StaticTypeLookup
1::typeIndex` is not supported by burst
at Burst.Compiler.IL.ILVisitor.NotSupported (Burst.Compiler.IL.Syntax.ILInstruction inst) [0x0016b] in :0
at Burst.Compiler.IL.ILVisitor.Ldsfld (Burst.Compiler.IL.Syntax.ILInstruction inst) [0x0006c] in :0
at Burst.Compiler.IL.ILVisitor.CompileInternal (Burst.Compiler.IL.Syntax.ILInstruction inst) [0x004de] in :0
at Burst.Compiler.IL.ILVerifier.CompileInternal (Burst.Compiler.IL.Syntax.ILInstruction inst) [0x00000] in :0
I looked at the code for EntityCommandBuffer.RemoveComponent() and I see that the generic parameter T is not bounded to struct and IComponentData like how they are in SetComponent() and AddComponent(). Is this the one causing the error?