Tip8:Unity中诸如 Awake() Start() Update()等函数的 执行顺序

时间:2023-03-08 16:39:33

Unity脚本中有很多的事件函数,下面是各种函数的执行顺序:

1.reset();

2.Awake();

3.OnEnable;

4.OnLevelWasLoaded();

5.Start();

6.OnApplicationPause();

7.FixedUpdate();

8.Update();

9.LateUpdate();

10.Rendering(渲染)类

11.Coroutines(协调程序)类

12.OnDestroy();

13.OnApplicationQuit();

14.OnDisable();

下图是Unity社区官方给的循环周期流程图:

Tip8:Unity中诸如 Awake() Start() Update()等函数的 执行顺序