示例#1
0
 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);
 }
 public void ExitCrouch()
 {
     if (crouchState != null)
     {
         crouchState.Exit();
         crouchState = null;
     }
 }
示例#3
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");
        dashState       = new PlayerDashState(this, stateMachine, playerData, "InAir");
        crouchIdleState = new PlayerCrouchIdleState(this, stateMachine, playerData, "IdleCrouch");
        crouchMoveState = new PlayerCrouchState(this, stateMachine, playerData, "MoveCrouch");
        primAtkState    = new PlayerPrimAtkState(this, stateMachine, playerData, "PrimAttack");
    }
示例#4
0
    private void Awake()
    {
        //Awake handles one time instatiation of the state machine and state components
        //Super States do not need to be instatiated
        StateMachine = new PlayerStateMachine();

        IdleState             = new PlayerIdleState(this, StateMachine, playerData, "idle");
        MoveState             = new PlayerMoveState(this, StateMachine, playerData, "move");
        TurnState             = new PlayerTurnState(this, StateMachine, playerData, "turn");
        JumpSquatState        = new PlayerJumpSquatState(this, StateMachine, playerData, "jumpSquat");
        JumpState             = new PlayerJumpState(this, StateMachine, playerData, "jump");
        InAirState            = new PlayerInAirState(this, StateMachine, playerData, "inAir");
        LandState             = new PlayerLandState(this, StateMachine, playerData, "land");
        DiveState             = new PlayerDiveState(this, StateMachine, playerData, "dive");
        DoubleJumpState       = new PlayerDoubleJumpState(this, StateMachine, playerData, "doubleJump");
        EndFallState          = new PlayerEndFallState(this, StateMachine, playerData, "endFall");
        StartFallState        = new PlayerStartFallState(this, StateMachine, playerData, "startFall");
        AbilityOneState       = new PlayerAbilityOneState(this, StateMachine, playerData, "abilityOne");
        CrouchState           = new PlayerCrouchState(this, StateMachine, playerData, "crouch");
        AbilityCrouchOneState = new PlayerAbilityCrouchOneState(this, StateMachine, playerData, "abilityCrouchOne");
        AbilityJumpOneState   = new PlayerAbilityJumpOneState(this, StateMachine, playerData, "abilityJumpOne");
        DodgeState            = new PlayerDodgeState(this, StateMachine, playerData, "dodge");
        AbilityTwoState       = new PlayerAbilityTwoState(this, StateMachine, playerData, "abilityTwo");
    }
 public void EnterCrouch()
 {
     crouchState = new PlayerCrouchState();
     crouchState.Enter(inputManager, this, components);
 }