Example #1
0
    void InitMoveCommand()
    {
        var leftMove  = new MoveCommand(movement2D, animator, transform, -1);
        var rightMove = new MoveCommand(movement2D, animator, transform, 1);
        var stopMove  = new MoveCommand(movement2D, animator, transform, 0);

        commandInvoker.AddCommand("LEFT_MOVE", leftMove);
        commandInvoker.AddCommand("RIGHT_MOVE", rightMove);
        commandInvoker.AddCommand("STOP_MOVE", stopMove);

        var dash = new DashCommand(movement2D);

        commandInvoker.AddCommand("DASH", dash);

        var jump = new JumpCommand(movement2D);

        commandInvoker.AddCommand("JUMP", jump);
        var downJump = new DownJumpCommand(movement2D);

        commandInvoker.AddCommand("DOWN_JUMP", downJump);

        var swordAttack = new SwordAttackCommand(playerBattle, animator);

        commandInvoker.AddAttackCommand("SWORD_ATTACK", swordAttack);
    }
 // Use this for initialization
 void Start()
 {
     buttonZ         = new Slowtime();
     buttonX         = new NormalizeTime();
     buttonLeftMouse = new FireWeapon();
     buttonESC       = new PauseGame();
     buttonSpace     = new JumpCommand();
     buttonLeftShift = new DashCommand();
     buttonB         = new ChangeWeapon();
 }
Example #3
0
 void InitInputManager()
 {
     ioMgr    = GetComponent <InputManager>();
     jump     = new JumpCommand(pc);
     stopJump = new StopJumpCommand(pc);
     dash     = new DashCommand(pc);
     left     = new MoveLeftCommand(pc);
     right    = new MoveRightCommand(pc);
     stopHor  = new StopMoveHorCommand(pc);
     up       = new MoveUpCommand(pc);
     down     = new MoveDownCommand(pc);
     stopVer  = new StopMoveVerCommand(pc);
     attack   = new AttackCommand(pc);
     interact = new InteractCommand(pc);
 }
Example #4
0
 private void initializeCommands()
 {
     buttonWSAD = new MoveCommand(rigidbody);
     buttonK    = new AbilityCommand(abilityAssets.arrow, this.gameObject);
     spacebar   = new DashCommand(rigidbody, dashAmount, transform);
 }