Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Question EntityCommandBuffer.SetSharedComponentData with entity reference

Discussion in 'Entity Component System' started by RamType0, Jan 5, 2021.

  1. RamType0

    RamType0

    Joined:
    Sep 11, 2018
    Posts:
    67
    Currently, EntityCommandBuffer.SetSharedComponentData<T> where T contains entity reference is not allowed.
    Why is it?

    Entity reference in shared component is one of the greatest way for creating domain.
    This limitation is blocking many scenario.

    IMHO, at least we have no worry about non-deferred entity reference in T.
    And we could distinguish whether entity reference is deferred by whether its entity index is negative.