Example #1
0
    private void Update()
    {
        if (climbing.isClimbing)
        {
            if (transform.localRotation.eulerAngles.z == 180 || transform.localRotation.eulerAngles.z == 0)
            {
                movement.Move(Input.GetAxis("Horizontal"), 0);
            }
            else
            {
                movement.Move(0, Input.GetAxis("Vertical"));
            }
        }
        else
        {
            movement.Move(Input.GetAxis("Horizontal"), 0);
        }

        if (Input.GetButtonDown("Jump"))
        {
            jump.JumpStart();
            climbing.ClimbingStop();
        }

        if (Input.GetKeyDown(KeyCode.W))
        {
            hide.HideStart();
        }
    }
Example #2
0
    void OnTriggerEnter2D(Collider2D other)
    {
        if (other.gameObject.layer == 8)
        {
            climbing.ClimbingStart();
        }

        if (other.gameObject.layer == 9)
        {
            climbing.ClimbingStop();
        }
    }