Exemple #1
0
 private void SetInitialVariables()
 {
     actualMovState = CharacterMovementState.Idle;
     pJumpState     = CharacterJumpState.Grounded;
     cDirector      = FindObjectOfType <CameraDirector>();
     playerSizeX    = SetPlayersizeX();
     playerSizeY    = SetPlayerSizeY();
     groundDistance = playerSizeY / 2 + .02f;
     maxXSpeed      = initialMaxSpeed;
 }
    public CharacterStateMachine(PlatformerController controller)
    {
        _controller = controller;

        IdleState      = new CharacterIdleState(this, _controller);
        MoveState      = new CharacterMoveState(this, _controller);
        JumpState      = new CharacterJumpState(this, _controller);
        FallingState   = new CharacterFallingState(this, _controller);
        WallSlideState = new CharacterWallSlideState(this, _controller);
        WallJumpState  = new CharacterWallJumpState(this, _controller);

        _state = IdleState;
    }
Exemple #3
0
 private void SetJumpState(CharacterJumpState incomingJumpState)
 {
     pJumpState = incomingJumpState;
 }
Exemple #4
0
 void ChangeJumpStatus(CharacterJumpState cs)
 {
     jumpStatus = cs;
 }