private void Awake()
 {
     _player = GetComponent <Player>();
     // grounded
     IdleState       = new PlayerIdleState(this, _player);
     MoveState       = new PlayerMoveState(this, _player);
     JumpState       = new PlayerJumpState(this, _player);
     LandState       = new PlayerLandState(this, _player);
     CrouchState     = new PlayerCrouchState(this, _player);
     CrouchMoveState = new PlayerCrouchMoveState(this, _player);
     // air
     AirJumpState = new PlayerAirJumpState(this, _player);
     FallingState = new PlayerFallingState(this, _player);
     // wall
     WallSlideState = new PlayerWallSlideState(this, _player);
     WallGrabState  = new PlayerWallGrab(this, _player);
     WallClimbState = new PlayerWallClimbState(this, _player);
     WallJumpState  = new PlayerWallJumpState(this, _player);
     // ledge
     LedgeClimbState = new PlayerLedgeClimbState(this, _player);
     // abilities
     DashState = new PlayerDashState(this, _player);
     // attacks
     GroundAttackState = new PlayerGroundAttackState(this, _player);
     AirAttackState    = new PlayerAirAttackState(this, _player);
     WallAttackState   = new PlayerWallAttackState(this, _player);
     BounceAttackState = new PlayerBounceAttackState(this, _player);
 }
Exemple #2
0
    private void Awake()
    {
        StateMachine = new PlayerStateMachine();

        IdleState       = new PlayerIdleState(this, StateMachine, playerData, "idle");
        MoveState       = new PlayerMoveState(this, StateMachine, playerData, "move");
        JumpState       = new PlayerJumpState(this, StateMachine, playerData, "inAir");
        InAirState      = new PlayerInAirState(this, StateMachine, playerData, "inAir");
        LandState       = new PlayerLandState(this, StateMachine, playerData, "land");
        WallSlideState  = new PlayerWallSlideState(this, StateMachine, playerData, "wallSlide");
        WallGrabState   = new PlayerWallGrabState(this, StateMachine, playerData, "wallGrab");
        WallClimbState  = new PlayerWallClimbState(this, StateMachine, playerData, "wallClimb");
        WallJumpState   = new PlayerWallJumpState(this, StateMachine, playerData, "inAir");
        LedgeClimbState = new PlayerLedgeClimbState(this, StateMachine, playerData, "ledgeClimbState");
        DashState       = new PlayerDashState(this, StateMachine, playerData, "inAir");
        AttackState     = new PlayerAttackState(this, StateMachine, playerData, "attack1");
        AirAttackState  = new PlayerAirAttackState(this, StateMachine, playerData, "attack2");
    }
        private void Awake()
        {
            _stateMachine    = new PlayerStateMachine();
            CombatController = new CombatController();

            IdleState        = new PlayerIdleState(this, _stateMachine, _playerData, AnimationConstants.PLAYER_IDLE_2_HASH);
            MoveState        = new PlayerMoveState(this, _stateMachine, _playerData, AnimationConstants.PLAYER_RUN_2_HASH);
            JumpState        = new PlayerJumpState(this, _stateMachine, _playerData, AnimationConstants.PLAYER_JUMP_HASH);
            InAirState       = new PlayerInAirState(this, _stateMachine, _playerData, AnimationConstants.PLAYER_AIR_HASH);
            LandState        = new PlayerLandState(this, _stateMachine, _playerData, AnimationConstants.PLAYER_LAND_HASH);
            WallSlideState   = new PlayerWallSlideState(this, _stateMachine, _playerData, AnimationConstants.PLAYER_WALL_SLIDING_HASH);
            LedgeClimbState  = new PlayerLedgeClimbState(this, _stateMachine, _playerData, AnimationConstants.PLAYER_LEDGE_GRAB_HASH);
            LedgeJumpState   = new PlayerLedgeJumpState(this, _stateMachine, _playerData, AnimationConstants.PLAYER_LEDGE_JUMP_HASH);
            CrouchIdleState  = new PlayerCrouchIdleState(this, _stateMachine, _playerData, AnimationConstants.PLAYER_CROUCH_IDLE_HASH);
            CrouchMoveState  = new PlayerCrouchMoveState(this, _stateMachine, _playerData, AnimationConstants.PLAYER_CROUCH_WALK_HASH);
            SwordAttackState = new PlayerSwordAttackState(this, _stateMachine, _playerData, AnimationConstants.PLAYER_ATTACK_1_HASH, 3);
            HandAttackState  = new PlayerHandAttackState(this, _stateMachine, _playerData, AnimationConstants.PLAYER_PUNCH_1_HASH, 5);
            AirAttackState   = new PlayerAirAttackState(this, _stateMachine, _playerData, AnimationConstants.PLAYER_AIR_ATTACK_1_HASH, 2);
            SlideState       = new PlayerSlideState(this, _stateMachine, _playerData, AnimationConstants.PLAYER_SLIDE_HASH);
            ItemState        = new PlayerItemState(this, _stateMachine, _playerData, AnimationConstants.PLAYER_USE_ITEM_HASH);
        }