标签:unity3d
Root
using UnityEngine; using System.Collections; public class RootScript : MonoBehaviour { public GameObject profab; void Awake() { Debug.Log(Time.time + "Root Awake"); } // Use this for initialization void Start () { Debug.Log(Time.time + "Root Start"); Invoke("startLoadUI", 0.1f); } private void startLoadUI() { GameObject go = Instantiate(profab) as GameObject; } }
Child
using UnityEngine; using System.Collections; public class ChildScript : MonoBehaviour { void Awake() { Debug.Log(Time.time + "Child Awake"); } // Use this for initialization void Start () { Debug.Log(Time.time + "Child Start"); } // Update is called once per frame void Update () { } }
运行结果
版权声明:本文为博主原创文章,未经博主允许不得转载。
记一下关于Instantiate时Awake Start的执行
标签:unity3d
原文地址:http://blog.csdn.net/lihuozhiling0101/article/details/46968223