So I’m trying to remove a dynamic buffer component off an entity like so:
public class LaneInitialization : SystemBase
{
private EndInitializationEntityCommandBufferSystem _endInitializationEcbSystem;
protected override void OnCreate()
{
_endInitializationEcbSystem = World.GetOrCreateSystem<EndInitializationEntityCommandBufferSystem>();
}
private void OnUpdate()
{
var ecb = _endInitializationEcbSystem.CreateCommandBuffer().AsParallelWriter();
Entities
.WithBurst()
.ForEach(
(Entity entity, int entityInQueryIndex)
=>
{
//...
ecb.RemoveComponent<DynamicBuffer<EntryNode>>(entityInQueryIndex, entity);
ecb.RemoveComponent<DynamicBuffer<OnStreetNode>>(entityInQueryIndex, entity);
ecb.RemoveComponent<DynamicBuffer<ExitNode>>(entityInQueryIndex, entity);
}).ScheduleParallel();
But I get an error saying:
Unknown Type:`Unity.Entities.DynamicBuffer`1[Components.EntryNode]` All ComponentType must be known at compile time. For generic components, each concrete type must be registered with [RegisterGenericComponentType].
I’ve searched the forum and documentation and tried to register the type in an AssemblyInfo.cs like so:
[assembly: RegisterGenericComponentType(typeof(DynamicBuffer<EntryNode>))]
But the error persists. Am I not reading the error correctly? For reference, this is my EntryNode
public struct EntryNode : IBufferElementData
{
public static implicit operator Translation(EntryNode e) { return e.Value; }
public static implicit operator EntryNode(Translation e) { return new EntryNode { Value = e }; }
public Translation Value;
}