43 lines
854 B
C#
43 lines
854 B
C#
|
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()
|
|||
|
{
|
|||
|
|
|||
|
}
|
|||
|
|
|||
|
}
|
|||
|
}
|