void OnEnable() { this.closeColorSchemeListAction(); // switch to the correct panel this.colorblindModeToggle.isOn = DataAndSettingsManager.getColorblindModeState(); this.smoothMovementToggle.isOn = DataAndSettingsManager.getSmoothMovementState(); this.musicToggle.isOn = DataAndSettingsManager.getMusicEnabledState(); this.soundsToggle.isOn = DataAndSettingsManager.getSoundsEnabledState(); }
void Awake() { foreach (Sound s in sounds) { s.source = this.gameObject.AddComponent <AudioSource>(); s.source.clip = s.clip; s.source.volume = s.volume; s.source.loop = s.loop; } this.musicEnabled = DataAndSettingsManager.getMusicEnabledState(); this.soundsEnabled = DataAndSettingsManager.getSoundsEnabledState(); }