Beispiel #1
0
    void OnGUI()
    {
        sliderThumb.overflow.left = sliderThumb.overflow.right = Mathf.RoundToInt(18.0F * (Screen.width / 814.0F));

        if (GUI.Button(MainMenu.AnchoredRect(), MainMenu.content, MainMenu.style))
        {
            audio.Play();
            GameObject.Find("PlayerData").GetComponent <PlayerData>().SaveData();
            MenuController.ChangeMenu(MainMenu.menuObject, this.gameObject);
        }

        settings.musicVolume = GUI.HorizontalSlider(
            Music.AnchoredRect(),
            settings.musicVolume,
            0.0f, 1.0f,
            sliderBar,
            sliderThumb);


        settings.sfxVolume = GUI.HorizontalSlider(
            SFX.AnchoredRect(),
            settings.sfxVolume,
            0.0f, 1.0f,
            sliderBar,
            sliderThumb);

        settings.playmode = GUI.SelectionGrid(
            Mode.AnchoredRect(),
            settings.playmode,
            modeTextures,
            modeTextures.Length,
            Mode.style);

        if (GUI.changed)
        {
            audio.Play();
        }
    }