Ejemplo n.º 1
0
 void Update()
 {
     if (!onLadder && playerState != PlatformerStates.airborne)
     {
         playerState = PlatformerStates.grounded;
     }
     if (onLadder && Input.GetKey("w"))
     {
         playerState = PlatformerStates.climbing;
         Climb();
     }
     if (onLadder && Input.GetKey("s"))
     {
         playerState = PlatformerStates.climbing;
         Descend();
     }
     if (playerState == PlatformerStates.grounded && Input.GetKey("d"))
     {
         MoveRight();
     }
     if (playerState == PlatformerStates.grounded && Input.GetKey("a"))
     {
         MoveLeft();
     }
     if (playerState == PlatformerStates.grounded && Input.GetKeyDown("space"))
     {
         Jump();
     }
 }
Ejemplo n.º 2
0
 void Start()
 {
     playerState = PlatformerStates.grounded;
 }