Beispiel #1
0
 private void KeypadEventConnector_ButtonReleased(object sender, KeypadButtonEventArgs e)
 {
     if (e.ButtonIndex == 2)
     {
         this.SubmitReleased?.Invoke(sender, EventArgs.Empty);
     }
 }
Beispiel #2
0
        bool IButtonParent.ButtonUp(int index)
        {
            var e = new KeypadButtonEventArgs(index);

            this.ButtonReleased?.Invoke(this, e);
            return(e.StayDown);             // It's never used, but we'll return it anyway.
        }
Beispiel #3
0
        private void KeypadEventConnector_ButtonPressed(object sender, KeypadButtonEventArgs e)
        {
            switch (e.ButtonIndex)
            {
            case 0: this.DownPressed?.Invoke(sender, EventArgs.Empty); break;

            case 1: this.UpPressed?.Invoke(sender, EventArgs.Empty); break;

            case 2: this.SubmitPressed?.Invoke(sender, EventArgs.Empty); break;
            }
        }
Beispiel #4
0
        bool IButtonParent.ButtonDown(int index)
        {
            var e = new KeypadButtonEventArgs(index);

            this.ButtonPressed?.Invoke(this, e);

            if (e.SuppressAutomaticRelease)
            {
                // LeanTween.description(GameObject) isn't in the version used by the game...
                foreach (var tween in (LTDescr[])typeof(LeanTween).GetField("tweens", BindingFlags.NonPublic | BindingFlags.Static).GetValue(null))
                {
                    KeypadButton button;
                    if (tween != null && tween.toggle && (button = this.buttons.FirstOrDefault(b => b.transform == tween.trans)) != null && button.ButtonIndex == index)
                    {
                        tween.setOnComplete((Action)null);
                        break;
                    }
                }
            }

            return(e.StayDown);
        }
 private void KeypadEventConnector_ButtonPressed(object sender, KeypadButtonEventArgs e)
 => this.ButtonPressed?.Invoke(this, new SimonButtonEventArgs((SimonButtons)e.ButtonIndex));
 private void KeypadEventConnector_ButtonPressed(object sender, KeypadButtonEventArgs e)
 => this.ButtonPressed?.Invoke(this, e);
 private void KeypadEventConnector_ButtonPressed(object sender, KeypadButtonEventArgs e)
 {
     this.SubmitPressed?.Invoke(this, EventArgs.Empty);
 }
 private void KeypadEventConnector_ButtonPressed(object sender, KeypadButtonEventArgs e)
 => this.ButtonPressed?.Invoke(sender, new MazeButtonEventArgs((MazeDirection)e.ButtonIndex));