Exemple #1
0
 void PlayerState()
 {
     if (Grounded())
     {
         state = State.Andando;
     }
     else if (Input.GetButtonDown("Fire1"))
     {
         RaycastHit hit;
         Ray        ray = Camera.main.ScreenPointToRay(Input.mousePosition);
         if (Physics.Raycast(ray, out hit))
         {
             if (state == State.Andando)
             {
                 pendulo.player.velocity = moveDir;
             }
             pendulo.MudarPivot(hit.point);
             state = State.Voando;
         }
     }
     else if (Input.GetButtonDown("Fire2"))
     {
         if (state == State.Voando)
         {
             state = State.Caindo;
         }
     }
 }