Search Unity

ECS Serialization and AddComponentObject

Discussion in 'Entity Component System' started by learc83, Mar 7, 2019.

  1. learc83

    learc83

    Joined:
    Feb 28, 2018
    Posts:
    41
    How does the ECS serialization handle Objects added to an entity through AddComponentObject?
     
  2. Singtaa

    Singtaa

    Joined:
    Dec 14, 2010
    Posts:
    492
    ArchetypeManager has an array of managed objects arrays. And, each chunk just has an int index for a particular Object[]. If you are referring to scene/world conversion, then the answer is :

    Code (CSharp):
    1. // SerializeUtility.cs:336
    2. if (archetype->NumManagedArrays != 0)
    3. {
    4.     throw new ArgumentException("Serialization of GameObject components is not supported for pure entity scenes");
    5. }
     
    Last edited: Mar 8, 2019