Exemplo n.º 1
0
 private void Update()
 {
     if (postman.isMissionComplete())
     {
         nextStage = true;
     }
     else if (nextStage && Input.GetKeyDown(KeyCode.Space))
     {
         Debug.Log("The next scene is under construction!");
     }
     if (Input.GetKeyDown(KeyCode.R) || postman.isDying())
     {
         SceneManager.LoadScene(SceneManager.GetActiveScene().name);
     }
 }
Exemplo n.º 2
0
 private void HandleMovement()
 {
     if (!rest && !state.isMissionComplete())
     {
         HandleJump();
         HandleAxisMovement();
     }
     else if (!rest)
     {
         rb.velocity = Vector2.zero;
         rest        = true;
     }
     else
     {
         if (state.isGrounded())
         {
             rb.AddForce(jumpHeight * Vector2.up, ForceMode2D.Impulse);
         }
     }
 }