Search Unity

What is entity.Index?

Discussion in 'Entity Component System' started by Mr-Mechanical, Jan 23, 2019.

  1. Mr-Mechanical

    Mr-Mechanical

    Joined:
    May 31, 2015
    Posts:
    507
    Hi,

    I'm interested in information about entity.Index. Is it unique to each entity?

    Thank you for the help.
     
  2. Mr-Mechanical

    Mr-Mechanical

    Joined:
    May 31, 2015
    Posts:
    507
    Thank you for the speedy response with more info. So my interpretation: no current entities can have the same index, but if some entities are destroyed then the indexes may be reused (?). Is this correct?
     
    Antypodish and Lurking-Ninja like this.
  3. JesOb

    JesOb

    Joined:
    Sep 3, 2012
    Posts:
    1,109
    Yes :)
     
    Mr-Mechanical likes this.
  4. Exactly. This is why the version and the index together is the proper address of an entity. I don't have these things in the front of me, but if I remember correctly it's the Id.
     
    Mr-Mechanical and Antypodish like this.