void Awake() { _creation = GetComponentInChildren <SettingCreation>(true); _creation.TryQualityForPlatform(out _quality, true, false); _creation.TryResolutionForPlatform(out _resolution, 800, 600, null, false, false); _creation.TryLanguageForPlatform(out _language, false, false); _creation.TryFullScreenForPlatform(out _fullScreen, false); _creation.TryVolumeForPlatform("Master Volume", out _master, 1, false, false); _creation.TryVolumeForPlatform("Music Volume", out _music, 1, false, false); _creation.TryVolumeForPlatform("SFX Volume", out _soundEffect, 1, false, false); var buttonLayout = _creation.HorizontalLayout("Buttons"); if (_creation.TryForPlatform("Apply", true, out _apply)) { _creation.AddToLayout(buttonLayout, _apply); _apply.onClick.AddListener(ApplyChanges); } if (_creation.TryForPlatform("Cancel", true, out _cancel)) { _creation.AddToLayout(buttonLayout, _cancel); } }
protected override void OnInitialize() { _settingsPanel = GameObjectUtilities.FindGameObject("SettingsContainer/SettingsPanelContainer"); _creator = _settingsPanel.GetComponentInChildren <SettingCreation>(); _creator.Wipe(); _creator.SetLabelAlignment(TextAnchor.MiddleLeft); _creator.TryLanguageForPlatform(out _language, false, true, "SETTINGS_LABEL_LANGUAGE"); _creator.TryResolutionForPlatform(out _resolution, 960, 540, null, false, true, "SETTINGS_LABEL_RESOLUTION"); _creator.TryFullScreenForPlatform(out _fullScreen, true, "SETTINGS_LABEL_FULLSCREEN"); _cancel = GameObjectUtilities.FindGameObject("SettingsContainer/SettingsPanelContainer/ButtonPanel/CancelButtonContainer").GetComponent <Button>(); _apply = GameObjectUtilities.FindGameObject("SettingsContainer/SettingsPanelContainer/ButtonPanel/ApplyButtonContainer").GetComponent <Button>(); }
protected override void OnInitialize() { _panel = GameObjectUtilities.FindGameObject(_panelRoute); _background = GameObjectUtilities.FindGameObject("BackgroundContainer/MenuBackgroundImage"); _creator = GameObjectUtilities.FindGameObject(_panelRoute + "/SettingsPanel").GetComponentInChildren <SettingCreation>(); _creator.Wipe(); Dropdown feedback; _creator.TryForPlatform("FEEDBACK_MODE", true, out feedback, true, false); feedback.GetComponent <DropdownLocalization>().SetOptions(new List <string> { "FEEDBACK_" + ScenarioController.FeedbackMode.EndGame, "FEEDBACK_" + ScenarioController.FeedbackMode.InReview, "FEEDBACK_" + ScenarioController.FeedbackMode.InGame }); feedback.value = PlayerPrefs.GetInt("Feedback", (int)ScenarioController.FeedbackMode.EndGame); feedback.onValueChanged.AddListener(OnFeedbackChange); _feedbackMode = feedback.Parent(); Dropdown language; _creator.TryLanguageForPlatform(out language, true, false); language.onValueChanged.AddListener(OnLanguageChange); _creator.RebuildLayout(); GameObjectUtilities.FindGameObject(_panelRoute + "/SettingsPanel/BackButton").GetComponent <Button>().onClick.AddListener(OnBackClick); }