Esempio n. 1
0
 void OnMouseDown()
 {
     if (gameObject.name == "boat")
     {
         action.ToggleBoat();
     }
     else
     {
         action.ClickCharacter(character);
     }
 }
Esempio n. 2
0
 void Update()
 {
     if (Input.GetButtonDown("Fire1"))
     {
         Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition);
         if (Physics.Raycast(ray, out RaycastHit hit, 100f))
         {
             var todo      = hit.collider;
             var character = todo.GetComponent <CharacterController>();
             if (character)
             {
                 action.ClickCharacter(character);
             }
             else if (todo.transform.name == "Boat")
             {
                 action.ClickBoat();
             }
         }
     }
 }