Search Unity

  1. Unity 2019.2 is now released.
    Dismiss Notice

Filter Components

Discussion in 'Project Tiny' started by ER_Dolleman, Mar 18, 2019.

  1. ER_Dolleman

    ER_Dolleman

    Joined:
    Dec 10, 2018
    Posts:
    19
    What are my options for filtering components?

    Can I iterate over entities that don't have a specific component? Something like:
    Code (JavaScript):
    1. forEach([Component1, !Component2], () => { })
    I tried working with the EntityFilter since it can have optional components, but the performance impact seems quite big.
     
  2. Deleted User

    Deleted User

    Guest

    If i remember correctly, is something like:
    Code (JavaScript):
    1.  
    2. forEach([Component1], [ut.Subtractive(Component2)], () => { })
    3.  
     
    Zoelovezle and ER_Dolleman like this.
  3. ER_Dolleman

    ER_Dolleman

    Joined:
    Dec 10, 2018
    Posts:
    19
    That's exactly what I've been looking for, thanks!
     
  4. Deleted User

    Deleted User

    Guest

    You are welcome ;)