Beispiel #1
0
 public void loadsettings()
 {
     gamesettings             = JsonUtility.FromJson <Gamesettings>(File.ReadAllText(Application.persistentDataPath + "/gamesettings.json"));
     resolutiondropdown.value = gamesettings.resolutionindex;
     musicvolumeslider.value  = gamesettings.musicvolume;
     fullscreentoggle.isOn    = gamesettings.fullscreen;
     resolutiondropdown.RefreshShownValue();
 }
Beispiel #2
0
    private void OnEnable()
    {
        gamesettings = new Gamesettings();
        fullscreentoggle.onValueChanged.AddListener(delegate { onfullscreentoggle(); });
        resolutiondropdown.onValueChanged.AddListener(delegate { onresolutionchange(); });

        musicvolumeslider.onValueChanged.AddListener(delegate { onmusicvolume(); });
        resolution = Screen.resolutions;
        applybutton.onClick.AddListener(delegate { onapplybuttonclick(); });
        foreach (Resolution resolution in resolution)
        {
            resolutiondropdown.options.Add(new Dropdown.OptionData(resolution.ToString()));
        }
        loadsettings();
    }
Beispiel #3
0
 void onEnable()
 {
     gamesettings = new Gamesettings();
 }
Beispiel #4
0
    //=======  declared variables======================================//



    void onEnable()
    {
        gamesettings        = new Gamesettings();
        Screen.sleepTimeout = SleepTimeout.NeverSleep;
    }