The previous 2 tests the order of the Gameobject, as well as the timing of awake and onenable:
Unity script Execution Sequence test in the hierarchy Panel 1
Http://www.cnblogs.com/hont/p/4298110.html
Unity script Execution Sequence test in the Hierarchy Panel 2
Http://www.cnblogs.com/hont/p/5034419.html
"Unity script in order of execution in the hierarchy Panel Test 1" To get a conclusion:
1. Non-prefab gameobject, the execution sequence is related to the time that he was created, and the later the execution order of the creation is the higher priority.
2.Prefab gameobject, the execution sequence is down from the root node.
I thought the components were in the same order as Gameobject, but the results were very surprising. Whether non-prefab or prefab, the execution order is related to the creation time
Non-prefab:
Prefab:
So, since the order of creation, change the order of execution can be so: (measured, it is best not to directly change the source files, the order of the source files more chaotic ...)
First create a script with key A3, then A2, and then A1. Then swap the script order.
In this way, the creation time is sorted by: A3->A2->A1
Test the call order of the-unity component