Beispiel #1
0
        private void Initialize()
        {
            if (_initialized)
            {
                return;
            }
            _messageText = GameObjectHelpers.FindGameObject(gameObject, "Message")?.GetComponent <Text>();

            _cancelBTNObject = GameObjectHelpers.FindGameObject(gameObject, "CancelBTN");
            _cancelBTN       = _cancelBTNObject?.GetComponent <Button>();
            _cancelBTNText   = _cancelBTNObject?.GetComponentInChildren <Text>(true);
            _cancelBTN?.onClick.AddListener(() =>
            {
                OnCancelButtonClick?.Invoke(_messageId);
                HideMessageBox();
            });

            _confirmButtonObject = GameObjectHelpers.FindGameObject(gameObject, "ConfirmBTN");
            _confirmBTNText      = _confirmButtonObject?.GetComponentInChildren <Text>(true);
            _confirmBTN          = _confirmButtonObject?.GetComponent <Button>();
            _confirmBTN?.onClick.AddListener(() =>
            {
                OnConfirmButtonClick?.Invoke(_messageId);
                HideMessageBox();
            });

            _initialized = true;
        }
Beispiel #2
0
 private void buttonCancel_Click(object sender, EventArgs e)
 {
     OnCancelButtonClick?.Invoke(sender, e);
 }
Beispiel #3
0
 public void CancelProcess(object tokenSource)
 {
     OnCancelButtonClick?.Invoke(this, EventArgs.Empty);
 }
Beispiel #4
0
 private void CancelBtn_Click(object sender, RoutedEventArgs e)
 {
     OnCancelButtonClick?.Invoke();
 }