Legacy Documentation: Version 2018.2 (Go to current version)
LanguageEnglish
  • C#

InitializeOnLoadMethodAttribute

class in UnityEditor

Description

Allow an editor class method to be initialized when Unity loads without action from the user.

using UnityEngine;
using UnityEditor;

class MyClass { [InitializeOnLoadMethod] static void OnProjectLoadedInEditor() { Debug.Log("Project loaded in Unity Editor"); } }
对文档有任何疑问,请移步至开发者社区提问,我们将尽快为您解答