Versions with this page:
Versions without this page:
class in UnityEditor
允许在 Unity 加载时初始化编辑器类方法,无需用户操作。
using UnityEngine; using UnityEditor;class MyClass { [InitializeOnLoadMethod] static void OnProjectLoadedInEditor() { Debug.Log("Project loaded in Unity Editor"); } }