Exemple #1
0
    public void Pause()
    {
        if (!isSceneEnded())
        {
            this.paused = !isPaused();

            if (this.paused)
            {
                ControlInstantiatePrefabs.sharedLayerControl().prefabLayerControl(0);
            }
            else
            {
                Time.timeScale = 1.0f;
            }
        }
    }
Exemple #2
0
    private void Update()
    {
        base.Update();

        if (Input.GetKey(KeyCode.Escape))
        {
            System.Diagnostics.Process.GetCurrentProcess().Kill();
        }

        if (isSceneEndedPending())
        {
            this.setSceneEndedPending(false);

            this.endScene();
        }

        if (isSceneEnded() && !stopFunction)
        {
            if (sceneEndedState == SceneEndedStatus.won)
            {
                if (!PlayerStateControl.sharePlayer().getAnimation().IsPlaying("ganhando"))
                {
                    this.stopFunction = true;

                    this.screenFadeOut();
                }
            }
            else
            {
                if (!PlayerStateControl.sharePlayer().getAnimation().IsPlaying("morrendo") &&
                    !PlayerStateControl.sharePlayer().getAnimation().IsPlaying("morreu"))
                {
                    this.stopFunction = true;

                    ControlInstantiatePrefabs.sharedLayerControl().prefabLayerControl(1);
                }
            }
        }
    }