当对象加载时调用此函数。
using UnityEngine; using UnityEditor; using UnityEditor.Experimental.AssetImporters;
public class ExampleScript : AssetImporterEditor { public override void OnEnable() { base.OnEnable(); Debug.Log("editor was enabled"); } }
OnEnable 不能作为协程。