Example #1
0
        private void OnHandleTurnAction(object sender, PlayerInputEventArgs e)
        {
            var inputControl = e.SourceInputControl as AxisInputControl;

            if (inputControl == null)
            {
                return;
            }
            m_turnInput = inputControl.AxisValue;
        }
Example #2
0
        private void OnHandleThurstAction(object sender, PlayerInputEventArgs e)
        {
            var inputControl = e.SourceInputControl as AxisInputControl;

            if (inputControl == null)
            {
                return;
            }
            m_thrustInput = Mathf.Clamp01(inputControl.AxisValue);
        }
        public static void TriggerEvent(PlayerInputControls.ActionType actionType, InputControl sourceInputControl)
        {
            EventHandler <PlayerInputEventArgs> currentEvent = null;
            var playerInputEvents = Instance.m_playerInputEvents;

            if (playerInputEvents.TryGetValue(actionType, out currentEvent))
            {
                var e = new PlayerInputEventArgs();
                e.ActionType = actionType;
                //e.SourceInputControl = Instance.m_inputControls.GetInputControl(actionType);
                e.SourceInputControl = sourceInputControl;
                playerInputEvents[actionType](Instance, e);
            }
        }
Example #4
0
 private void OnHandleFireEvent(object sender, PlayerInputEventArgs e)
 {
     Fire();
 }