Unity-生命周期函数调用顺序
程序员文章站
2022-07-12 23:33:28
...
//==========================
// - FileName: UnityCallOrder.cs
// - Created: true.
// - CreateTime: 2020/05/27 17:41:11
// - Email: aaa@qq.com
// - Region: China WUHAN
// - Description: Unity 生命周期函数
//==========================
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class UnityCallOrder : MonoBehaviour
{
void Awake()
{
print("Awake");
}
void Start()
{
print("Start");
}
void OnEnable()
{
print("OnEnable");
}
void Update()
{
print("Update");
}
void LateUpdate()
{
print("LateUpdate");
}
void FixedUpdate()
{
print("FixedUpdate");
}
void OnGUI()
{
print("OnGUI");
Destroy(gameObject);
}
void OnDisable()
{
print("OnDisable");
}
void OnDestroy()
{
print("OnDestroy");
}
void Reset()
{
print("Reset");
}
}
上一篇: unity3D学习8