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(); }
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(); }
void onEnable() { gamesettings = new Gamesettings(); }
//======= declared variables======================================// void onEnable() { gamesettings = new Gamesettings(); Screen.sleepTimeout = SleepTimeout.NeverSleep; }