awake 只调用一次, awake在所有obj都初始化之后被调用. 用途: 初始化游戏状态 设置脚本间的引用 ### ExecuteInEditMode 编辑模式下 ``` 这个模式下,脚本编译,会自动reload [ExecuteInEditMode] public class LifecycleTest : MonoBehaviour {} When new component (this script) is added: Awake(), OnEnable(), Reset(), St
原文地址: http://www.cnblogs.com/ysdyaoguai/p/3746828.html In Unity scripting, there are a number of event functions that get executed in a predetermined order as a script executes. This execution order is described below: 在Unity脚本中,有一些按照预定顺序执行的事件函数,脚本即是