// Use this for initialization void Start() { raycastFromCamera = GetComponent<RaycastFromCamera>(); // Subscriber registers for info from notifyLayerChangeObservers and says // that when OnLayerChange is called the method “OnLayerChanged” should be called. raycastFromCamera.notifyLayerChangeObservers += OnLayerChanged; }
// Use this for initialization void Start() { animator = GetComponent <Animator>(); raycastFromCamera = FindObjectOfType <RaycastFromCamera>(); // Subscriber registers for info from notifyLeftMouseClickObservers and says // that when notifyLeftMouseClickObservers is called the method “AttackEnemy” should be called. raycastFromCamera.notifyLeftMouseClickObservers += ClickToAttack; }
void Start() { raycastFromCamera = FindObjectOfType <RaycastFromCamera>(); animator = GetComponent <Animator>(); navMeshAgent = GetComponent <NavMeshAgent>(); stats = GetComponent <Stats>(); // Subscriber registers for info from notifyLeftMouseClickObservers and says // that when notifyLeftMouseClickObservers is called the method “ClickToMove” should be called. raycastFromCamera.notifyLeftMouseClickObservers += HandleClick; }