Unity
[Unity] MonoBehaviour Life Cycle
공길이의 숨겨진 세상
2023. 7. 19. 14:56
using UnityEngine;
using System.Collections;
public class NewBehaviourScript : MonoBehaviour {
float cnt=0;
void Reset(){
Debug.Log("Reset");
}
void Awake(){
Debug.Log("Awake");
}
void OnEnable(){
Debug.Log("OnEnable");
}
void Start(){
Debug.Log("start");
}
void FixedUpdate(){
Debug.Log("FixedUpdate");
}
void Update (){
Debug.Log("Update");
if ((cnt+=Time.deltaTime) >1.0f) Destroy(this.gameObject);
}
void LateUpdate(){
Debug.Log("LastUpdate");
}
void OnWillRenderObject(){
Debug.Log("OnWillRenderObject");
}
void OnGUI(){
Debug.Log("OnGUI");
}
void OnDisable(){
Debug.Log("OnDisable");
}
void OnDestroy(){
Debug.Log("OnDestroy");
}
}
1초 동안 함수를 호출 했을때 띄워지는 호출 순서