毕业了,这几天找工作,昨天看到雨松MOMO写了一篇关于unity函数执行顺序的博客,我没事做也试了一下,呵呵~~
using UnityEngine; using System.Collections; public class Order : MonoBehaviour { void Awake() { print ("Awake"); } // Use this for initialization void Start () { print ("Start"); } void OnEnable() { print ("OnEnable"); } // Update is called once per frame 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"); } }