Table of Contents

Unity程序的关键时间点


热重载时

[UnityEditor.Callbacks.DidReloadScripts] # Unity Hot Reload(在进入PlayMode的时候,也会被调用)

引擎启动时

[InitializeOnLoadAttribute] # 打开Editor时候执行([待验证]进入PlayMode时会执行吗)。[文档]Allows you to initialize an Editor class when Unity loads, and when your scripts are recompiled.

状态变更时(Edit/Play)

EditorApplication.playModeStateChanged # Delegation