文档

Unity Engine

Unity Engine

InitializeOnLoadMethodAttribute

Allow an editor class method to be initialized when Unity loads without action from the user.
阅读时间3 分钟最后更新于 1 个月前

Definition

[AttributeUsage(AttributeTargets.Method)]public class InitializeOnLoadMethodAttribute : Attribute

Examples

using UnityEngine;using UnityEditor;class MyClass{ [InitializeOnLoadMethod] static void OnProjectLoadedInEditor() { Debug.Log("Project loaded in Unity Editor"); }}

Inheritance

Inherited Members