public bool GetSound(SettingsActions action) { if (action == SettingsActions.Music) { return(settingSystem.IsMusicMuted); } else if (action == SettingsActions.Sound) { return(settingSystem.IsSoundMuted); } throw new NotImplementedException(); }
public void UpdateSound(SettingsActions action, bool isMuted) { if (action == SettingsActions.Music) { settingSystem.IsMusicMuted = isMuted; } else if (action == SettingsActions.Sound) { settingSystem.IsSoundMuted = isMuted; } settingSystem.Save(); UpdateSound(); }
private void InitializeButtons() { // get/create buttons englishButton = transform.Find("English Button").gameObject.GetComponent <FocusableContentButton>(); germanButton = transform.Find("German Button").gameObject.GetComponent <FocusableContentButton>(); dutchButton = transform.Find("Dutch Button").gameObject.GetComponent <FocusableContentButton>(); SettingsActions actions = gameObject.AddComponent <SettingsActions>(); // set button data englishButton.Data = (int)Language.ENGLISH; germanButton.Data = (int)Language.GERMAN; dutchButton.Data = (int)Language.DUTCH; OnUpdateLanguage(); // set button actions englishButton.OnButtonPressed = ChangeLanguage; germanButton.OnButtonPressed = ChangeLanguage; dutchButton.OnButtonPressed = ChangeLanguage; }
private void InitializeButtons() { // get/create buttons closeButton = transform.Find("Close Button").gameObject.GetComponent <FocusableButton>(); languageButton = transform.Find("Language Button").gameObject.GetComponent <FocusableContentButton>(); modelServerButton = transform.Find("Model Server Button").gameObject.GetComponent <FocusableContentButton>(); gamificationServerButton = transform.Find("Gamification Server Button").gameObject.GetComponent <FocusableContentButton>(); sharingServerButton = transform.Find("Sharing Server Button").gameObject.GetComponent <FocusableContentButton>(); sharingEnabledButton = transform.Find("Sharing Enabled Button").gameObject.GetComponent <FocusableContentButton>(); collisionButton = transform.Find("Collision Detection Button").gameObject.GetComponent <FocusableContentButton>(); versionLabel = transform.Find("Version Label").gameObject.GetComponent <TextMesh>(); SettingsActions actions = gameObject.AddComponent <SettingsActions>(); // set button actions closeButton.OnPressed = Close; languageButton.OnPressed = ChangeLanguage; modelServerButton.OnPressed = actions.EnterServer; gamificationServerButton.OnPressed = actions.EnterGamificationServer; sharingServerButton.OnPressed = actions.EnterSharingServer; sharingEnabledButton.OnPressed = () => { actions.ToggleSharing(); SetButtonContents(); }; collisionButton.OnPressed = () => { actions.ToggleCollision(); SetButtonContents(); }; OnUpdateLanguage(); // set contents SetButtonContents(); }