// Class Functions: protected override void InitializeStates() { #region Create States: #region Movement States: standingState = new PlayerStandingState(this, stateMachine); combatIdleState = new PlayerCombatIdleState(this, stateMachine); movingState = new PlayerMovingState(this, stateMachine); jumpingState = new PlayerJumpingState(this, stateMachine); fallingState = new PlayerFallingState(this, stateMachine); crouchingState = new PlayerCrouchingState(this, stateMachine); dashingState = new PlayerDashingState(this, stateMachine); sprintingState = new PlayerSprintingState(this, stateMachine); sprintRecoveryState = new PlayerSprintRecoveryState(this, stateMachine); slidingState = new PlayerSlidingState(this, stateMachine); slidingJumpState = new PlayerSlidingJumpState(this, stateMachine); standingGuardState = new PlayerStandingGuardState(this, stateMachine); walkingState = new PlayerWalkingState(this, stateMachine); crouchingGuardState = new PlayerCrouchingGuardState(this, stateMachine); #endregion // Movement States #region Action States: lightActionState = new PlayerLightActionState(this, stateMachine); mediumActionState = new PlayerMediumActionState(this, stateMachine); heavyActionState = new PlayerHeavyActionState(this, stateMachine); #endregion // Action States #region Reaction States: //burstState = new PlayerBurstState(this, stateMachine); //hitHighState = new PlayerHitHighState(this, stateMachine); //hitMedState = new PlayerHitMedState(this, stateMachine); //hitLowState = new PlayerHitLowState(this, stateMachine); //hitAirState = new PlayerHitAirState(this, stateMachine); //recoveryState = new PlayerRecoveryState(this, stateMachine); //knockbackState = new PlayerKnockbackState(this, stateMachine); //knockdownState = new PlayerKnockdownState(this, stateMachine); //deathState = new PlayerDeathState(this, stateMachine); #endregion // Reaction States #region Combat States: #region Unarmed States: #region Normals: #endregion // Normals #region Specials: //airAxeKick = new AirAxeKick(this, stateMachine); //airDragonPunch = new AirDragonPunch(this, stateMachine); feintRoll = new FeintRoll(this, stateMachine); //groundDragonPunch = new GroundDragonPunch(this, stateMachine); //hookKick = new HookKick(this, stateMachine); //lowKick = new LowKick(this, stateMachine); //rollingAxeKick = new RollingAxeKick(this, stateMachine); //snapKick = new SnapKick(this, stateMachine); //thrustKick = new ThrustKick(this, stateMachine); //verticalKick = new VerticalKick(this, stateMachine); #endregion // Specials #endregion // Unarmed States #endregion // Combat States #endregion // Create States // Initialize the starting states startState = standingState; }
private void Start() { // Instantiate states GroundState = new PlayerGroundState(this); JumpingState = new PlayerJumpingState(this); IdleState = new PlayerIdleState(this); // Initialize settings State = GroundState; PreferredMaxSpeed = 50.0f; // Make sure we don't move too fast Health = HealthMax; // Full health Mass = 1; }
//public Animator animator; private void Awake() { stateMachine = new StateMachine <AlexPlayerController>(this); playerIdleState = new PlayerIdleState(); playerRunningState = new PlayerRunningState(); playerJumpingState = new PlayerJumpingState(); playerFallingState = new PlayerFallingState(); playerAttackingState = new PlayerAttackingState(); stateMachine.ChangeState(playerIdleState); rb = GetComponent <Rigidbody>(); attackHitboxScript = attackHitboxObject.GetComponent <HitBoxController>(); }