- Protoyped on the AI movement, found solutions for turns and moving after impacting the player. - Created a full base for AI state machine. - Worked on binding the core AI logic with the finite state machine.
37 lines
793 B
C#
37 lines
793 B
C#
using UnityEngine;
|
|
|
|
public class ChargeState : BaseState
|
|
{
|
|
public ChargeState(AICarDriver aiCarDriver, GameplayManager gameplayManager) : base(aiCarDriver, gameplayManager)
|
|
{
|
|
Debug.Log($"### {this} constructor");
|
|
}
|
|
|
|
protected override void Enter()
|
|
{
|
|
base.Enter();
|
|
|
|
Debug.Log($"### {this} Enter STAGE");
|
|
// update the values for charging
|
|
}
|
|
|
|
protected override void Update()
|
|
{
|
|
base.Update();
|
|
|
|
Debug.Log($"### {this} Update STAGE");
|
|
aiCarDriver.UpdateMovement(() =>
|
|
{
|
|
base.Exit();
|
|
nextState = new ImpactState(aiCarDriver, gameplayManager);
|
|
});
|
|
}
|
|
|
|
protected override void Exit()
|
|
{
|
|
base.Exit();
|
|
|
|
Debug.Log($"### {this} Exit STAGE");
|
|
}
|
|
}
|