Version: 2020.3
public void OnEnable ();

描述

当对象加载时调用此函数。

using UnityEngine;
using UnityEditor;
using UnityEditor.AssetImporters;

public class ExampleScript : AssetImporterEditor { public override void OnEnable() { base.OnEnable(); Debug.Log("editor was enabled"); } }

OnEnable 不能作为协程。