Exemple #1
0
 private void Awake()
 {
     StateMachine   = new PlayerStateMachine();
     IdleState      = new PlayerIdleState(this, StateMachine, playerData, "idle");
     MoveState      = new PlayerMoveState(this, StateMachine, playerData, "move");
     RunState       = new PlayerRunState(this, StateMachine, playerData, "run");
     JumpState      = new PlayerJumpState(this, StateMachine, playerData, "inAir");
     LandState      = new PlayerLandState(this, StateMachine, playerData, "land");
     InAirState     = new PlayerInAirState(this, StateMachine, playerData, "inAir");
     DoubleJump     = new PlayerDoubleJumpState(this, StateMachine, playerData, "doubleJump");
     WallSlideState = new PlayerWallSlideState(this, StateMachine, playerData, "wallSlide");
     WallJumpState  = new PlayerWallJumpState(this, StateMachine, playerData, "inAir");
 }
Exemple #2
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");
    }