InitializeOnLoadMethodAttribute
Allow an editor class method to be initialized when Unity loads without action from the user.
読み終わるまでの所要時間 3 分最終更新 25日前
Definition
- Type: Class
- Namespace: UnityEditor
- Assembly: UnityEditor
- Inherits from: Attribute
- Implements: _Attribute
[AttributeUsage(AttributeTargets.Method)]public class InitializeOnLoadMethodAttribute : Attribute, _Attribute
Examples
using UnityEngine;using UnityEditor;class MyClass{ [InitializeOnLoadMethod] static void OnProjectLoadedInEditor() { Debug.Log("Project loaded in Unity Editor"); }}