Search Unity

Array Serialization Inconsistencies (Unity 5)

Discussion in 'Editor & General Support' started by MongooseJV, Feb 18, 2017.

  1. MongooseJV

    MongooseJV

    Joined:
    Feb 25, 2014
    Posts:
    20
    So I have a simple array defined that is public to hold references to already created monobehavior scripts. Everything looks fine in the editor:

    array01.jpg

    However, as soon as I hit play, not all of the elements are properly serialized:

    array02.jpg

    Here is how the array is defined below (Cells):

    array03.jpg

    I made sure that there is nothing running when the scripts are loaded that would reset or clear out the array. Is there something else I'm missing?

    My goal is to probably have this a private field (which shouldn't serialize at all)... Doing so would mean that I would have to recreate the array and assign references. Before I go down that route I really want to know what is going on here...

    Thanks,
    - Jeff