Ejemplo n.º 1
0
 private void ClickOnObjective()
 {
     if (Input.GetMouseButtonDown(0))
     {
         ray = camera.ScreenPointToRay(Input.mousePosition);
         RaycastHit hit_;
         if (Physics.Raycast(ray, out hit_, 200.0f))
         {
             currentTarget.DisableCursor();
             Debug.DrawRay(ray.GetPoint(0.0f), ray.direction * 70.0f, Color.blue);
             currentTarget = hit_.collider.gameObject.GetComponent <Stats>().parent.GetComponent <CharacterBattle>();
             currentTarget.EnableCursor();
         }
         else if (!EventSystem.current.IsPointerOverGameObject())
         {
             Debug.DrawRay(ray.GetPoint(0.0f), ray.direction * 70.0f, Color.red);
         }
     }
 }