SHADE_Y3/Assets/Scripts/Gameplay/AIBehaviour/AIRework/States/AlertState.cs

43 lines
854 B
C#
Raw Normal View History

2023-03-24 13:26:18 +08:00
using SHADE;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace SHADE_Scripting.Gameplay.AIBehaviour.AIRework.States
{
public class AlertState: AIBaseState
{
const float alertDuration = 2.0f;
float alertTimer = alertDuration;
public AlertState(StateMachine machine): base(machine)
{
stateName = "Alert";
}
public override void OnEnter()
{
alertTimer = alertDuration;
}
public override void update()
{
alertTimer -= Time.DeltaTimeF;
if (alertTimer <= 0.0f)
{
machine.SetState(typeof(ChaseState));
}
}
public override void fixedUpdate()
{
}
}
}