Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Removing an ISharedComponentData

Discussion in 'Entity Component System' started by orionburcham, Jan 26, 2019.

  1. orionburcham

    orionburcham

    Joined:
    Jan 31, 2010
    Posts:
    488
    Can
    EntityManager.RemoveComponent()
    and
    EntityCommandBuffer.RemoveComponent()
    be used to remove an ISharedComponentData?

    I am looking to move a single entity from an archetype chunk with an ISharedComponentData, to a chuck with the exact same component layout, minus that ISharedComponentData.

    I am *not* looking to change or remove the ISharedComponentData from all entities that currently have it.

    Thanks!
     
  2. tertle

    tertle

    Joined:
    Jan 25, 2011
    Posts:
    3,626
    Not sure about ecb as I've never tried, it probably does, but the regular remove component definitely works.
     
    orionburcham likes this.
  3. orionburcham

    orionburcham

    Joined:
    Jan 31, 2010
    Posts:
    488
    Much obliged!