Example #1
0
    private void Awake()
    {
        instance = this;

        StateMachine = new PlayerStateMachine();

        IdleState           = new PlayerIdleState(this, StateMachine, "idle");
        MoveState           = new PlayerMoveState(this, StateMachine, "move");
        JumpState           = new PlayerJumpState(this, StateMachine, "inAir");
        InAirState          = new PlayerInAirState(this, StateMachine, "inAir");
        LandState           = new PlayerLandState(this, StateMachine, "land");
        WallSlideState      = new PlayerWallSlideState(this, StateMachine, "wallSlide");
        WallJumpState       = new PlayerWallJumpState(this, StateMachine, "inAir");
        LedgeClimbState     = new PlayerLedgeClimbState(this, StateMachine, "ledgeClimbState");
        DashState           = new PlayerDashState(this, StateMachine, "dash");
        SlideState          = new PlayerSlideState(this, StateMachine, "slide");
        HurtState           = new PlayerHurtState(this, StateMachine, "hurt");
        SwordComboState     = new PlayerSwordComboState(this, StateMachine, "swordCombo");
        KnockDownState      = new PlayerKnockDownState(this, StateMachine, "knockdown");
        GetUpState          = new PlayerGetUpState(this, StateMachine, "getUp");
        KickComboState      = new PlayerKickComboState(this, StateMachine, "kickCombo");
        MagicStrongState    = new PlayerMagicStrongState(this, StateMachine, "strongCast");
        WeakMagicState      = new PlayerWeakMagicState(this, StateMachine, "weakCast");
        FullPowerMagicState = new PlayerFullPowerMagicState(this, StateMachine, "fullPowerMagicCast");
        DeadState           = new PlayerDeadState(this, StateMachine, "dead");
        FlyingKickState     = new PlayerFlyingKickState(this, StateMachine, "flyingKick");
    }
Example #2
0
    void slide()
    {
        BurinkeruCharacterController characterController = (BurinkeruCharacterController)this.characterController;

        if (characterController == null)
        {
            return;
        }

        if (groundedInternalState != null)
        {
            groundedInternalState.Exit();
        }

        PlayerSlideState slideState = new PlayerSlideState();

        slideState.OnExitSlideStateRequested += onExitSlideStateRequested;
        slideState.Enter(inputManager, characterController, components);
        groundedInternalState = slideState;
    }
        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);
        }