I am building a game that does on the fly creation of the world at the beginning of each level (I am living with the lag time of creating, and destroying objects on the fly, and since it is for PC it is acceptable). I have prefabs that have children with scripts that will instantiate other GameObjects in their Awake()
(work around for nested prefabs, and some functionality), and then logs that gameObject for referencing/tracking/bookKeeping.
If I have a script classA
that Instantiates an object thingB
at lineX
will the scripts attached to thingB
have their Awake/constructor methods called before lineX+1
of classA
is processed so that I can access members of those scripts attached to thingB
, or will I have to do that in a different place (like having all of these things created in classA
Awake, and then start accessing those members in classA
Start)?