ScriptableObject.OnEnable 当启用

function OnEnable () : void

Description描述

Creates an instance of a scriptable object with T.

创建一个可编写脚本对象T的一个实例。

This function is called when the object is loaded

当物体被加载的时候调用此函数。

using UnityEngine;
using System.Collections;

public class example : MonoBehaviour {
	void OnEnable() {
		print("script was enabled");
	}
}
function OnEnable () {
	print("script was enabled");
}

OnEnable cannot be a co-routine.

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

Page last updated: 2011-4-11