Beispiel #1
0
    public void Pause(Text buttonText)
    {
        SimulationDriver mainModule = GameObject.Find("CrustMesh").GetComponent <SimulationDriver>();

        if (paused)
        {
            //Show "playing" UI
            buttonText.text = "Pause";

            reEnergiseBtn.gameObject.SetActive(false);
            randDirectionBtn.gameObject.SetActive(false);
            seaLvlInputField.gameObject.SetActive(false);
            volFreqInputField.gameObject.SetActive(false);

            mainModule.PauseOrPlay(false, seaLvlInputField.text, volFreqInputField.text);
        }
        else
        {
            //Show "paused" UI
            buttonText.text = "Play";

            reEnergiseBtn.gameObject.SetActive(true);
            randDirectionBtn.gameObject.SetActive(true);
            seaLvlInputField.gameObject.SetActive(true);
            volFreqInputField.gameObject.SetActive(true);

            mainModule.PauseOrPlay(true);
        }
        paused = !paused;
    }