-
Notifications
You must be signed in to change notification settings - Fork 0
/
IdleSM.cs
36 lines (30 loc) · 817 Bytes
/
IdleSM.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.AI;
public class IdleSM :AIState
{
[SerializeField]
float idleDuration = 5;
float totalDuration;
public IdleSM(NavMeshAgent ag, FiniStateMachine st, KitchenHelper hp, STATUS _status, stateType stateTYPE, Animator an) : base(ag, st, hp, _status, stateTYPE, an)
{
}
public override void EnterState()
{
base.EnterState();
totalDuration = 0;
}
public override void ExitState()
{
base.ExitState();
}
public override void UPDATING()
{
totalDuration += Time.deltaTime;
if (totalDuration >= idleDuration)
{
stateMachine.changeState(stateType.cake);
}
}
}