void Awake() { view = GetComponent<NetView>(); inventory = GetComponent<Inventory>(); catAnimator = GetComponentInChildren<CatAnimator>(); view.OnReadInstantiateData += Instantiate; InputHandler.Instance.ListenToKeyDown(TryPickup, KeyBind.Code(Bind.Interact)); }
void Awake() { view = GetComponent<NetView>(); catAnimator = GetComponentInChildren<CatAnimator>(); inventory = GetComponent<Inventory>(); // 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>(); inventory = GetComponent <Inventory>(); catAnimator = GetComponentInChildren <CatAnimator>(); view.OnReadInstantiateData += Instantiate; InputHandler.Instance.ListenToKeyDown(TryPickup, KeyBind.Code(Bind.Interact)); }
void Awake() { view = GetComponent <NetView>(); catAnimator = GetComponentInChildren <CatAnimator>(); inventory = GetComponent <Inventory>(); // 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; }