Search Unity

<>

Discussion in 'Entity Component System' started by Warsymphony, Jan 19, 2020.

  1. Warsymphony

    Warsymphony

    Joined:
    Sep 23, 2014
    Posts:
    43
    .
     
    Last edited: Jan 21, 2020
  2. DreamingImLatios

    DreamingImLatios

    Joined:
    Jun 3, 2017
    Posts:
    4,264
    First, think of Entities as handles to data rather than containing it. They are like keys.

    You can store a dynamic buffer (resizable list) attached to an entity. This avoids the needs for tables.
     
    Warsymphony likes this.
  3. BackgroundMover

    BackgroundMover

    Joined:
    May 9, 2015
    Posts:
    224
    I think, like Latios said, Entities are like keys. Components are like rows. The fields in the component are like fields in a table.

    Nah, just if you have a table named Customer, make a public struct Customer : IComponentData that has the same int Age, etc.

    To continue the SQL analogy I'd say EntityQueries are like SELECT and JOIN. Only, instead of a new table that contains all the columns (if thats how join works) the tables keep their independent identities rather than being ephemerally merged.
     
    Warsymphony likes this.