Пример #1
0
        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
                    });
                }
            });
        }
Пример #2
0
 private void OnCloseButton_Click(object sender, EventArgs e)
 {
     if (CloseButtonClicked != null)
     {
         CloseButtonClicked.Invoke(this, null);
     }
 }
Пример #3
0
        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));
        }
Пример #4
0
 private void btnClose_Click(object sender, EventArgs e)
 {
     CloseButtonClicked?.Invoke(this, EventArgs.Empty);
 }
Пример #5
0
 private void OnCloseButtonClicked()
 {
     CloseButtonClicked?.Invoke(this, new PropertyChangedEventArgs("CloseButtonClicked"));
 }
Пример #6
0
 private void CloseButton_PreviewMouseLeftButtonUp(object sender, MouseButtonEventArgs e)
 {
     CloseButtonClicked?.Invoke(this, EventArgs.Empty);
     CloseButton.PreviewMouseLeftButtonUp -= CloseButton_PreviewMouseLeftButtonUp;
 }
Пример #7
0
 protected internal virtual void OnCloseButtonClicked(CancelEventArgs e)
 {
     CloseButtonClicked?.Invoke(this, e);
 }
Пример #8
0
 private void OnCloseButtonPointerUp()
 {
     CloseButtonClicked?.Invoke();
 }
Пример #9
0
 private void TextBlock_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)
 {
     CloseButtonClicked?.Invoke(this, EventArgs.Empty);
 }