Beispiel #1
0
 public void CloseMenu()
 {
     deathMenu.SetActive(false);
     levelCompleteMenu.SetActive(false);
     pauseMenuController.PauseGame(false);
     DeathMenuState = DeathMenuState.Closed;
 }
Beispiel #2
0
    public void OpenMenu()
    {
        pauseMenuController.PauseGame(true);

        // Opens the last opened menu.
        switch (lastValidHubMenu)
        {
        case HubMenuState.Perks:
            OpenPerkMenu();
            break;
        }
    }
    // Update is called once per frame
    void Update()
    {
        blockChceck = GameObject.FindGameObjectWithTag(Tags.BLOCK);

        if (blockChceck == null)
        {
            Victory();
        }
        if (Input.GetKeyDown(KeyCode.Escape))
        {
            Debug.Log("Escape down");
            pauseMenu.PauseGame();
        }
    }
Beispiel #4
0
    // Update is called once per frame
    void Update()
    {
        float move = Input.GetAxis("Horizontal");

        moveX = move * maxSpeed;


        if (Input.GetKeyDown(KeyCode.Space) && isGrounded)
        {
            moveY = 5;
        }
        else
        {
            moveY = rb2d.velocity.y;
        }

        rb2d.velocity = new Vector3(moveX, moveY);

        if (move <= 0.1 && move >= -0.1)
        {
            if (isGrounded)
            {
                ResetRotation();
                animator.Play("idle");
            }
            else
            {
                FreezRotation();
                animator.Play("jump");
            }
        }
        else
        {
            if (isGrounded)
            {
                ResetRotation();
                animator.Play("run");
            }
            else
            {
                FreezRotation();
                animator.Play("jump");
            }
        }

        if (move < 0 && !facingLeft)
        {
            Flip();
        }
        else if (move > 0 && facingLeft)
        {
            Flip();
        }

        if (rb2d.transform.position.y <= -5)
        {
            PauseMenuController.PauseGame();
        }
    }
Beispiel #5
0
 public void PauseGame()
 {
     _pauseController.PauseGame();
 }