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; }
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; }