Update() private method

private Update ( ) : void
return void
Esempio n. 1
0
    // Update is called once per frame
    void Update()
    {
        tapHandler.Update();

        if (tapHandler.IsTapped())
        {
            // If nobody is speaking right now AND message box isn't up
            if (FindObjectsOfType <SayDialog>().Length == 0 && !MessageBox.activeSelf)
            {
                // If we are paused
                if (PausePanelAnimator.GetBool("Pause"))
                {
                    // Unpause
                    Time.timeScale = 1;
                    PausePanelAnimator.SetBool("Pause", false);
                    Array.ForEach(FindObjectsOfType <AudioSource>(), (audio) => audio.volume = 1);
                }
                else
                {
                    // Pause
                    Time.timeScale = 0;
                    PausePanelAnimator.SetBool("Pause", true);
                    Array.ForEach(FindObjectsOfType <AudioSource>(), (audio) => audio.volume = 0.2f);
                }
            }
        }
    }
    private void Update()
    {
        // Updates submit handler
        _submitHandler.Update();

        // If we're pressing submit
        if (_submitHandler.IsTapped())
        {
            // We've effectively pressed OK
            OKPress();
        }
    }