public static void AddCommandToReplayList(HybridCommand command) { if (!ReplayMode) { //OldCommands.Add(command); } }
public override HybridBaseState Execute(GameObject objectToActUpon, HybridCommand command) { Action(objectToActUpon); CharacterHybridController.AddCommandToReplayList(command); return(new HybridMovingState()); }
void HandleInput() { Vector2 movementDirection = Vector2.zero; if (Input.GetKey(KeyForward)) { CurrentCommand = MakeCommand <HybridMoveCommands>(); movementDirection.x += 0.1f; } if (Input.GetKey(KeyLeft)) { CurrentCommand = MakeCommand <HybridMoveCommands>(); movementDirection.y += 0.1f; } if (Input.GetKey(KeyReverse)) { CurrentCommand = MakeCommand <HybridMoveCommands>(); //SetCurrentCommandToType (typeof(HybridMoveCommands)); movementDirection.x += -0.1f; } if (Input.GetKey(KeyRight)) { CurrentCommand = MakeCommand <HybridMoveCommands>(); //SetCurrentCommandToType (typeof(HybridMoveCommands)); movementDirection.y += -0.1f; } HybridBaseState state = null; if (CurrentCommand != null) { state = CurrentCommand.Execute(Character, CurrentCommand); } //TODO: Change this to be a generic type of command it takes if (state != null) { state.HandleInput(Character, movementDirection); } CurrentCommand = null; }
//TODO: Make these abstract? public virtual HybridBaseState Execute(GameObject objectToActUpon, HybridCommand command) { return(new HybridBaseState()); }
public void ChangeCommandKeyBind(KeyCode key, HybridCommand command) { //switch with KeyCodes, then set appropriately }