Ejemplo n.º 1
0
        public override void OnMove(InputAction.CallbackContext context)
        {
            if (!context.performed || _currentInitialIdx < 0)
            {
                return;
            }

            if (context.performed)
            {
                Vector3 direction = context.ReadValue <Vector2>();
                // TODO: this is a little awkward because it's easy
                // to accidentally hit it when going up / down

                /*if(direction.x > 0.0f) {
                 *  NextInitial();
                 * } else if(direction.x < 0.0f) {
                 *  PreviousInitial();
                 * } else*/
                if (direction.y != 0.0f)
                {
                    _pollAdvanceLetter = true;
                    _pollCooldownTimer.Stop();

                    AdvanceLetter();
                    _pollCooldownTimer.AddTime(_pollCooldown);
                }
            }
            else if (context.canceled)
            {
                _pollAdvanceLetter = false;
            }
        }
Ejemplo n.º 2
0
        private void OnStartButtonPressed(object sender, EventArgs e)
        {
            switch (microwaveState)
            {
            case MicrowaveOvenState.CLOSED:
                microwaveState = MicrowaveOvenState.RUNNING;
                timer.Start();
                HeaterOn = true;
                break;

            case MicrowaveOvenState.OPENED:
                break;

            case MicrowaveOvenState.RUNNING:
                timer.AddTime();
                break;

            default:
                throw new Exception("Unhandled state: " + microwaveState);
            }
        }