/// <summary> /// Load the existing game options in to options fields /// </summary> private void LoadOptionsInToUI() { //Load Options from Manager GameOptionsInfo loadedOptions = GameOptionsManager.GetCurrentGameOptions(); //Load values in to ui elements musicVolumeSlider.value = loadedOptions.musicVolume; sfxVolumeSlider.value = loadedOptions.sfxVolume; }
/// <summary> /// Apply the game options currently held by ui elements /// </summary> public void ApplyGameOptions() { //Convert UI Values in to GameOptions class and pass to save to file GameOptionsInfo pendingOptions = new GameOptionsInfo(); pendingOptions.musicVolume = musicVolumeSlider.value; pendingOptions.sfxVolume = sfxVolumeSlider.value; GameOptionsManager.SaveGameOptions(pendingOptions); }
/// <summary> /// Apply the game options currently held by ui elements /// Called by button press in inspector /// </summary> public void ApplyGameOptions() { //Convert UI Values in to GameOptions class and pass to save to file GameOptionsInfo pendingOptions = new GameOptionsInfo { musicVolume = musicVolumeSlider.value, sfxVolume = sfxVolumeSlider.value, playerName = nameInput.text, phoneRotOffset = calibrationValues.lastCalibrationValues.eulerAngles }; GameOptionsManager.SaveGameOptions(pendingOptions); }