void Awake() { KeyboardButtons.ForEach(key => key.onClick.AddListener(() => PlayerName.text += key.gameObject.name)); ClearSymbolButton.onClick.AddListener(() => { if (PlayerName.text.Length > 0) { PlayerName.text = PlayerName.text.Remove(PlayerName.text.Length - 1); } }); ClearAllButton.onClick.AddListener(() => PlayerName.text = string.Empty); CloseButton.onClick.AddListener(() => CloseButtonClicked?.Invoke(null, null)); SaveButton.onClick.AddListener(() => { if (!string.IsNullOrWhiteSpace(PlayerName.text)) { NewRecordCreated?.Invoke(null, new PlayerRecord() { Name = PlayerName.text, Score = Result.Score, Date = $"{DateTime.Now.Day}.{DateTime.Now.Month}.{DateTime.Now.Year.ToString().Remove(0, 2)}", Position = Position }); } }); }
private void OnCloseButton_Click(object sender, EventArgs e) { if (CloseButtonClicked != null) { CloseButtonClicked.Invoke(this, null); } }
void Awake() { EnhanceGraphicsToggle.onValueChanged.AddListener((value) => PPPrefab.SetActive(value)); ResolutionDropDown.onValueChanged.AddListener((value) => { if (value == 0) { Screen.SetResolution(1920, 1080, Screen.fullScreen); } if (value == 1) { Screen.SetResolution(1280, 720, Screen.fullScreen); } if (value == 2) { Screen.SetResolution(800, 600, Screen.fullScreen); } }); SoundVolumeSlider.onValueChanged.AddListener((value) => GameManager.Instance.SoundVolume = value / 2); CloseButton.onClick.AddListener(() => CloseButtonClicked?.Invoke(null, null)); }
private void btnClose_Click(object sender, EventArgs e) { CloseButtonClicked?.Invoke(this, EventArgs.Empty); }
private void OnCloseButtonClicked() { CloseButtonClicked?.Invoke(this, new PropertyChangedEventArgs("CloseButtonClicked")); }
private void CloseButton_PreviewMouseLeftButtonUp(object sender, MouseButtonEventArgs e) { CloseButtonClicked?.Invoke(this, EventArgs.Empty); CloseButton.PreviewMouseLeftButtonUp -= CloseButton_PreviewMouseLeftButtonUp; }
protected internal virtual void OnCloseButtonClicked(CancelEventArgs e) { CloseButtonClicked?.Invoke(this, e); }
private void OnCloseButtonPointerUp() { CloseButtonClicked?.Invoke(); }
private void TextBlock_MouseLeftButtonUp(object sender, MouseButtonEventArgs e) { CloseButtonClicked?.Invoke(this, EventArgs.Empty); }