Search Unity

Adding Buffer to multiple entities

Discussion in 'Entity Component System' started by Tazadar66, Oct 13, 2018.

  1. Tazadar66

    Tazadar66

    Joined:
    Aug 27, 2013
    Posts:
    57
    Hello there !

    I know you can add a buffer with this command EntityManager.AddBuffer<T>(entity)
    But is it possible to add buffers to multiples entities at once ?
    Do I have to use a loop ?

    Thank you :)
     
  2. recursive

    recursive

    Joined:
    Jul 12, 2012
    Posts:
    669
    EntityCommandBuffer has functions to add/set/remove DynamicBuffers on entities. I dont know of any bulk operators for components in general just entity instantiation.
     
  3. Tazadar66

    Tazadar66

    Joined:
    Aug 27, 2013
    Posts:
    57
    Thank you for your help :)

    I will just use a loop then.