// Start is called before the first frame update void Start() { lockOnList = new List <GameObject>(); walkState = new PlayerWalkState(this.gameObject, this, keyconfig, arm, gun); standState = new PlayerStandState(this.gameObject, this, keyconfig, arm, gun); rollState = new PlayerRollState(this.gameObject, this, keyconfig); rollState.particle = dustParticle; hitboxes = GetComponentsInChildren <Collider2D>(); Initialize(startState: standState); }
private void Awake() { FiniteStateMachine = new PlayerFiniteStateMachine(); SkillManager = new PlayerSkillsManager(); StatsManager = new PlayerStatsManager(_playerStatsData); IdleState = new PlayerIdleState(this, FiniteStateMachine, "idle", _idleStateData); MoveState = new PlayerMoveState(this, FiniteStateMachine, "move", _moveStateData); LandState = new PlayerLandState(this, FiniteStateMachine, "land"); JumpState = new PlayerJumpState(this, FiniteStateMachine, "inAir", _jumpStateData); InAirState = new PlayerInAirState(this, FiniteStateMachine, "inAir", _inAirStateData); WallSlideState = new PlayerWallSlideState(this, FiniteStateMachine, "wallSlide", _wallSlideStateData); WallGrabState = new PlayerWallGrabState(this, FiniteStateMachine, "wallGrab"); WallClimbState = new PlayerWallClimbState(this, FiniteStateMachine, "wallClimb", _wallClimbStateData); WallJumpState = new PlayerWallJumpState(this, FiniteStateMachine, "inAir", _wallJumpStateData); LedgeClimbState = new PlayerLedgeClimbState(this, FiniteStateMachine, "ledgeClimbState", _ledgeClimbStateData); DashState = new PlayerDashState(this, FiniteStateMachine, "inAir", _dashStateData); RollState = new PlayerRollState(this, FiniteStateMachine, "rollState", _rollStateData); CrouchIdleState = new PlayerCrouchIdleState(this, FiniteStateMachine, "crouchIdle", _crouchIdleStateData); CrouchMoveState = new PlayerCrouchMoveState(this, FiniteStateMachine, "crouchMove", _crouchMoveStateData); OnRopeStateAim = new PlayerOnRopeState_Aim(this, FiniteStateMachine, "idle", _onRopeStateData); OnRopeStateAttach = new PlayerOnRopeState_Attach(this, FiniteStateMachine, "inAir", _onRopeStateData); OnRopeStateMove = new PlayerOnRopeState_Move(this, FiniteStateMachine, "inAir", _onRopeStateData); OnRopeStateFinish = new PlayerOnRopeState_Finish(this, FiniteStateMachine, "inAir", _onRopeStateData); SwordAttackState01 = new PlayerSwordAttackState_01(this, FiniteStateMachine, "swordAttack01", _swordAttackPosition01, _swordAttackStateData01); SwordAttackState02 = new PlayerSwordAttackState_02(this, FiniteStateMachine, "swordAttack02", _swordAttackPosition02, _swordAttackStateData02); SwordAttackState03 = new PlayerSwordAttackState_03(this, FiniteStateMachine, "swordAttack03", _swordAttackPosition03, _swordAttackStateData03); FireArrowShotStateStart = new PlayerBowFireArrowShotState_Start(this, FiniteStateMachine, "bowFireShotStart", _fireArrowShotAttackPosition, _fireArrowShotStateData); FireArrowShotStateAim = new PlayerBowFireArrowShotState_Aim(this, FiniteStateMachine, "bowFireShotAim", _fireArrowShotAttackPosition, _fireArrowShotStateData); FireArrowShotStateFinish = new PlayerBowFireArrowShotState_Finish(this, FiniteStateMachine, "bowFireShotFinish", _fireArrowShotAttackPosition, _fireArrowShotStateData); StunState = new PlayerStunState(this, FiniteStateMachine, "stun", StunStateData); DeadState = new PlayerDeadState(this, FiniteStateMachine, "dead", _deadStateData); }
public static void Initialize() { endTurnState = new EndTurnState(playerTurnState); playerLandedState = new PlayerLandedState(endTurnState); playerMoveState = new PlayerMoveState(playerLandedState); playerRollState = new PlayerRollState(playerMoveState); playerTurnState = new PlayerTurnState(playerRollState); initialState = new InitialState(playerTurnState); endTurnState.NextState = playerTurnState; States.Add("InitialState", initialState); States.Add("PlayerTurnState", playerTurnState); States.Add("PlayerRollState", playerRollState); States.Add("PlayerMoveState", playerMoveState); States.Add("PlayerLandedState", playerLandedState); States.Add("EndTurnState", endTurnState); }
public void InitializePlayerStateMachine() { idleState = new PlayerIdleState(stateMachine, this, AlfAnimationHash.IDLE_0, playerData); walkState = new PlayerWalkState(stateMachine, this, AlfAnimationHash.RUN_0, playerData); jumpState = new PlayerJumpState(stateMachine, this, AlfAnimationHash.JUMP_0, playerData); inAirState = new PlayerInAirState(stateMachine, this, AlfAnimationHash.INAIR_0, playerData); meleeAttackState = new PlayerMeleeAttackState(stateMachine, this, AlfAnimationHash.ATTACK_0, playerData); parryState = new PlayerParryState(stateMachine, this, AlfAnimationHash.PARRY_1, playerData); rollState = new PlayerRollState(stateMachine, this, AlfAnimationHash.ROLL_0, playerData); stunState = new PlayerStunState(stateMachine, this, AlfAnimationHash.STUN_0, playerData); deadState = new PlayerDeadState(stateMachine, this, AlfAnimationHash.DEAD_0, playerData); takeDamageState = new PlayerTakeDamageState(stateMachine, this, AlfAnimationHash.TAKEDAMAGE_0, playerData); wallState = new PlayerWallState(stateMachine, this, AlfAnimationHash.WALL_0, playerData); dashState = new PlayerDashState(stateMachine, this, AlfAnimationHash.DASH_0, playerData); converseState = new PlayerConverseState(stateMachine, this, AlfAnimationHash.IDLE_0, playerData); cinemaState = new PlayerCinemaState(stateMachine, this, AlfAnimationHash.IDLE_0, playerData); ladderState = new PlayerLadderState(stateMachine, this, AlfAnimationHash.IDLE_0, playerData); InitializePlayerCooldownTimer(); }
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"); CrouchIdleState = new PlayerCrouchIdleState(this, StateMachine, playerData, "crouchIdle"); CrouchMoveState = new PlayerCrouchMoveState(this, StateMachine, playerData, "crouchMove"); InjuredState = new PlayerInjuredState(this, StateMachine, playerData, "injured"); DeadState = new PlayerDeadState(this, StateMachine, playerData, "dead"); KickState = new PlayerKickState(this, StateMachine, playerData, "kick"); SlideKickState = new PlayerSlideKickState(this, StateMachine, playerData, "slideKick"); RollState = new PlayerRollState(this, StateMachine, playerData, "roll"); }
public void InitializePlayerStateMachine() { idleState = new PlayerIdleState(stateMachine, this, AlfAnimationHash.IDLE_0, playerData); walkState = new PlayerWalkState(stateMachine, this, AlfAnimationHash.RUN_0, playerData); jumpState = new PlayerJumpState(stateMachine, this, AlfAnimationHash.JUMP_0, playerData); inAirState = new PlayerInAirState(stateMachine, this, AlfAnimationHash.INAIR_0, playerData); meleeAttackState = new PlayerMeleeAttackState(stateMachine, this, AlfAnimationHash.ATTACK_IRONSWORD, playerData); bowAttackState = new PlayerBowAttackState(stateMachine, this, AlfAnimationHash.IDLE_WOODBOW, playerData); magicAttackState = new PlayerMagicAttackState(stateMachine, this, AlfAnimationHash.IDLE_APPRENTICE_STICK, playerData); parryState = new PlayerParryState(stateMachine, this, AlfAnimationHash.PARRY_1, playerData); rollState = new PlayerRollState(stateMachine, this, AlfAnimationHash.ROLL_0, playerData); stunState = new PlayerStunState(stateMachine, this, AlfAnimationHash.STUN_0, playerData); deadState = new PlayerDeadState(stateMachine, this, AlfAnimationHash.DEAD_0, playerData); takeDamageState = new PlayerTakeDamageState(stateMachine, this, AlfAnimationHash.TAKEDAMAGE_0, playerData); wallState = new PlayerWallState(stateMachine, this, AlfAnimationHash.WALL_0, playerData); dashState = new PlayerDashState(stateMachine, this, AlfAnimationHash.DASH_0, playerData); converseState = new PlayerConverseState(stateMachine, this, AlfAnimationHash.IDLE_0, playerData); cinemaState = new PlayerCinemaState(stateMachine, this, AlfAnimationHash.IDLE_0, playerData); ladderState = new PlayerLadderState(stateMachine, this, AlfAnimationHash.IDLE_0, playerData); wakeupState = new PlayerWakeupState(stateMachine, this, AlfAnimationHash.WAKEUP_SITUP_0, playerData); littleSunState = new PlayerLittleSunState(stateMachine, this, AlfAnimationHash.LITTLESUN_SIT_0, playerData); InitializePlayerCooldownTimer(); }