Ejemplo n.º 1
0
	// 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; 
	}
Ejemplo n.º 2
0
 // 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;
 }
Ejemplo n.º 3
0
 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;
 }