ScriptableObject.OnDestroy 当销毁

function OnDestroy () : void

Description描述

This function is called when the scriptable object will be destroyed.

当可编写脚本对象将被销毁,这个函数被调用。

using UnityEngine;
using System.Collections;

public class example : MonoBehaviour {
    void OnDestroy() {
   	 print("Script was destroyed");
    }
}
function OnDestroy () {
	print("Script was destroyed");
}

OnEnable cannot be a co-routine.

OnEnable不能作为一个协同程序。

Page last updated: 2011-4-11