public class MonoLife : MonoBehaviour
{
private void Awake()
{
print("Awake:只要物体显示状态为true则调用一次");
}
private void OnEnable()
{
print("OnEnable:每一次物体启用时调用");
}
private void OnDisable()
{
print("OnDisable:每一次物体被关闭时调用");
}
private void OnDestroy()
{
print("OnDestroy:物体被销毁时调用");
}
private void OnApplicationPause(bool pause)
{
print("OnApplicationPause: " + pause);
}
private void OnApplicationQuit()
{
print("OnApplicationQuit:程序退出时调用");
}
void Start()
{
print("Start:物体和组件都启用则调用一次");
}
void Update()
{
print("Update:物体和组件都启用的状态下每一帧调用");
}
}
标签:常用,调用,启用,void,周期函数,private,Unity,print,物体
From: https://blog.csdn.net/weixin_44293732/article/details/141171932