MonoBehaviour.OnEnable 当可用

function OnEnable () : void

Description描述

This function is called when the object becomes enabled and active.

当对象变为可用或激活状态时此函数被调用。

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-1-2