Search Unity

Adding multiple components at a time

Discussion in 'Entity Component System' started by MartijnGG, Sep 10, 2018.

  1. MartijnGG

    MartijnGG

    Joined:
    May 3, 2018
    Posts:
    74
    Is there a proper way to add more then 1 component to an entity at a time?

    Currently, if I want to add 3 components to and entity, it will only be possible to do this one by one. Causing it to create and dispose of 2 intermediate Archetypes (and they chunks) in between.
    While this pretty fast, it still feels like wasted CPU cycles.

    Is there a method to go around this?
     
    Zoey_O likes this.
  2. mike_acton

    mike_acton

    Unity Technologies

    Joined:
    Nov 21, 2017
    Posts:
    110
    > Is there a method to go around this?
    If you are modifying an existing entity, then no. That's the best way.

    But I agree it's something we should address at some point and will make sure there's an issue for us to review.