Пример #1
0
 private void GetInputToMove()
 {
     if (Input.GetMouseButtonDown(0))
     {
         Ray        ray = cameraToRay.ScreenPointToRay(Input.mousePosition);
         RaycastHit hit;
         if (Physics.Raycast(ray, out hit))
         {
             characerController.MoveTo(hit.point);
         }
     }
 }
Пример #2
0
 private void GetInputToMove()
 {
     if (Input.touchCount > 0)
     {
         Touch      touch = Input.GetTouch(0);
         Ray        ray   = cameraToRay.ScreenPointToRay(touch.position);
         RaycastHit hit;
         if (Physics.Raycast(ray, out hit))
         {
             characerController.MoveTo(hit.point);
         }
     }
 }
Пример #3
0
 public void MoveTo(Vector3 position)
 {
     character.MoveTo(position);
 }