Exemple #1
0
        // TODO: Consider moving the game logic to a game controller or similar.
        /// <summary>
        /// Sends the specified stick signal (X and Y axis values) to the subscribers, depending on the passed GameInputContext.
        /// </summary>
        /// <param name="stick">Type of stick to check</param>
        public void SendStickEvent(GameInputStick stick)
        {
            if (currentContext == GameInputContext.InGame)
            {
                if (stick == GameInputStick.Left)
                {
                    TriggerEvent(PlayerMoveSignal, currentStickState[GameInputStick.Left][0], currentStickState[GameInputStick.Left][1]);
                }

                if (stick == GameInputStick.Right)
                {
                    // Send some signal
                }
            }
        }
Exemple #2
0
        /// <summary>
        /// Sends the specified stick signal (X and Y axis values) to the subscribers, depending on the passed GameInputContext.
        /// </summary>
        /// <param name="stick">Type of stick to check</param>
        public void SendStickEvent(GameInputStick stick)
        {
            if (currentContext == GameInputContext.InGame)
            {
                if (stick == GameInputStick.Left)
                {
                    if (PlayerMoveSignal != null)
                    {
                        PlayerMoveSignal.Invoke(currentStickState[GameInputStick.Left][0], currentStickState[GameInputStick.Left][1]);
                    }
                }

                if (stick == GameInputStick.Right)
                {
                    // Send some signal
                }
            }
        }