/// <summary> /// Copies this object and then resets it /// in preparation of the next update pass. /// Called by update-render loop. /// </summary> protected override void CopyAndResetForUpdatePassInternal(InputStateBase targetState) { var targetStateCasted = (GamepadState)targetState; targetStateCasted._controllerIndex = _controllerIndex; targetStateCasted._isConnected = _isConnected; targetStateCasted._prevState = _prevState; targetStateCasted._currentState = _currentState; }
public InputStateManager(GameController ParaGameController) { MainGameController = ParaGameController; // 不能再构造函数中call find函数 //MainInputStateBase.Initialize(); MainInputStateBase = new InputStateBase(); MainInputStateBase.SetGameController(MainGameController); InputStateOfName.Add("SelectInitialHandCard", new SelectInitialHandCard()); InputStateOfName.Add("Idle", new Idle()); InputStateOfName.Add("PieceOperation", new PieceOperation()); InputStateOfName.Add("HandCardOperation", new HandCardOperation()); }
public override void Do(Game g) { g.DebugAlert(DebugMode.InputStates, "RemoveTopInputStates(" + PlayerID + "," + Amount + ")\n"); g.DebugAlert(DebugMode.InputStates, "InputList Count: " + g.InputHandlers[PlayerID].GetInputList().Count.ToString() + "\n"); foreach (InputStateBase isb in g.InputHandlers[PlayerID].GetInputList()) { g.DebugAlert(DebugMode.InputStates, isb.ToString() + "\n"); } prevStates = new List <InputStateBase>(); for (Int32 i = 0; i < Amount; i++) { InputStateBase state = g.InputHandlers[PlayerID].GetInputList().Last(); prevStates.Add(state); state.Leave(); g.InputHandlers[PlayerID].RemoveInputFromList(state); } prevStates.Reverse(); }
void Start() { _mInputStateBase = InputManager.Instance.InputStatesBase[1]; }