Exemplo n.º 1
0
        void Awake() {
            view = GetComponent<NetView>();
            controller = GetComponent<NetController>();
            catAnimator = GetComponentInChildren<CatAnimator>();

            // Note: Always register OnReadInstantiateData delegate in Awake
            // OnReadInstantiateData is called immediately after a View is created, so registering
            // in Start instead of Awake means you might miss out on the instantiate data.
            view.OnReadInstantiateData += Instantiate;
        }
Exemplo n.º 2
0
        void Awake()
        {
            view        = GetComponent <NetView>();
            controller  = GetComponent <NetController>();
            catAnimator = GetComponentInChildren <CatAnimator>();

            // Note: Always register OnReadInstantiateData delegate in Awake
            // OnReadInstantiateData is called immediately after a View is created, so registering
            // in Start instead of Awake means you might miss out on the instantiate data.
            view.OnReadInstantiateData += Instantiate;
        }