Esempio n. 1
0
    // Update is called once per frame
    void Update()
    {
        //Check if the player let go
        if (Input.GetButtonDown("Let Go") && !PlayerController.inFlow)
        {
            StartCoroutine(flowInterface.JoinTheFlow());
        }

        if ((PlayerController.leftBuffering || PlayerController.rightBuffering) && flowInterface.GetExitPoint() != null)
        {
            float dirNum = AngleDir(transform.forward, flowInterface.GetExitPoint().position - transform.position, transform.up);
            if (dirNum < 0 && PlayerController.leftBuffering && !exiting)
            {
                StartCoroutine(flowInterface.ExitFlow());
                exiting = true;
                soundMan.Play(soundMan.pincerRock, -0.1f);
            }
            else if (dirNum > 0 && PlayerController.rightBuffering && !exiting)
            {
                soundMan.Play(soundMan.pincerRock, .7f, 0.1f);
                StartCoroutine(flowInterface.ExitFlow());
                exiting = true;
            }
        }

        //Get stick input
        hinput = Input.GetAxis("Horizontal");
        vinput = Input.GetAxis("Vertical");
    }