private void Start() { if (!initialDifficultyChoice) { chosenLife = ActualSave.actualSave.chosenLivesDifficulty; chosenTime = ActualSave.actualSave.chosenTimeDifficulty; TimeGroup.SetAllTogglesOff(); LivesGroup.SetAllTogglesOff(); switch (ActualSave.actualSave.chosenLivesDifficulty) { case 1: Lives1.Check(); break; case 2: Lives2.Check(); break; default: Lives0.Check(); break; } switch (ActualSave.actualSave.chosenTimeDifficulty) { case 1: Time1.Check(); break; case 2: Time2.Check(); break; default: Time0.Check(); break; } } else { ActualSave.actualSave.chosenLivesDifficulty = -2; ActualSave.actualSave.chosenTimeDifficulty = -2; Debug.Log("Initial difficulty setting"); } }
private void Awake() { audioSource = this.GetComponent <AudioSource>(); if (Time.timeScale > 0.01f) { /*fader = this.GetComponent<UIFader>(); * if(fader) * fader.FadeIn(); * fillBackground.color = Color.clear;*/ } else { this.GetComponent <CanvasGroup>().alpha = 1f; } if (Screen.fullScreen) { fullScreenToggle.Check(); } else { fullScreenToggle.Uncheck(); } //SOUND SLIDERS INITIALIZATION float value; audioMixer.GetFloat("GlobalVolume", out value); VolumeSlider.value = value; VolumeSlider.Refresh(); audioMixer.GetFloat("MusicVolume", out value); MusicVolumeSlider.value = value; MusicVolumeSlider.Refresh(); audioMixer.GetFloat("SoundVolume", out value); SoundVolumeSlider.value = value; SoundVolumeSlider.Refresh(); qualityDropdown.value = QualitySettings.GetQualityLevel(); resolutions = Screen.resolutions; resolutionDropdown.ClearOptions(); List <string> options = new List <string>(); int currentResolutionIndex = 0; for (int i = 0; i < resolutions.Length; i++) { string option = resolutions[i].width + " x " + resolutions[i].height; options.Add(option); if (resolutions[i].width == Screen.currentResolution.width && resolutions[i].height == Screen.currentResolution.height) { currentResolutionIndex = i; } } resolutionDropdown.AddOptions(options); resolutionDropdown.value = currentResolutionIndex; resolutionDropdown.RefreshShownValue(); GameObject.FindGameObjectsWithTag("InputHandler")[0].GetComponent <InputHandler>().addObserver(this); }