protected override void OnSpawn() { base.OnSpawn(); title.SetText(UI.FRONTEND.GRAPHICS_OPTIONS_SCREEN.TITLE); originalSettings = CaptureSettings(); applyButton.isInteractable = false; applyButton.onClick += OnApply; applyButton.GetComponentInChildren <LocText>().SetText(UI.FRONTEND.GRAPHICS_OPTIONS_SCREEN.APPLYBUTTON); doneButton.onClick += OnDone; closeButton.onClick += OnDone; doneButton.GetComponentInChildren <LocText>().SetText(UI.FRONTEND.GRAPHICS_OPTIONS_SCREEN.DONE_BUTTON); resolutionDropdown.ClearOptions(); BuildOptions(); resolutionDropdown.options = options; resolutionDropdown.onValueChanged.AddListener(OnResolutionChanged); fullscreenToggle.ChangeState(Screen.fullScreen ? 1 : 0); MultiToggle multiToggle = fullscreenToggle; multiToggle.onClick = (System.Action)Delegate.Combine(multiToggle.onClick, new System.Action(OnFullscreenToggle)); fullscreenToggle.GetComponentInChildren <LocText>().SetText(UI.FRONTEND.GRAPHICS_OPTIONS_SCREEN.FULLSCREEN); resolutionDropdown.transform.parent.GetComponentInChildren <LocText>().SetText(UI.FRONTEND.GRAPHICS_OPTIONS_SCREEN.RESOLUTION); if (fullscreenToggle.CurrentState == 1) { int resolutionIndex = GetResolutionIndex(originalSettings.resolution); if (resolutionIndex != -1) { resolutionDropdown.value = resolutionIndex; } } CanvasScalers = UnityEngine.Object.FindObjectsOfType <KCanvasScaler>(); UpdateSliderLabel(); uiScaleSlider.onValueChanged.AddListener(delegate { sliderLabel.text = uiScaleSlider.value + "%"; }); uiScaleSlider.onReleaseHandle += delegate { UpdateUIScale(uiScaleSlider.value); }; }