예제 #1
0
 public static void AddCommandToReplayList(HybridCommand command)
 {
     if (!ReplayMode)
     {
         //OldCommands.Add(command);
     }
 }
예제 #2
0
    public override HybridBaseState Execute(GameObject objectToActUpon, HybridCommand command)
    {
        Action(objectToActUpon);
        CharacterHybridController.AddCommandToReplayList(command);

        return(new HybridMovingState());
    }
예제 #3
0
    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;
    }
예제 #4
0
 //TODO: Make these abstract?
 public virtual HybridBaseState Execute(GameObject objectToActUpon, HybridCommand command)
 {
     return(new HybridBaseState());
 }
예제 #5
0
 public void ChangeCommandKeyBind(KeyCode key, HybridCommand command)
 {
     //switch with KeyCodes, then set appropriately
 }