Skip to content

Commit 80d128d

Browse files
committed
add StateMachineGeneric.ClearState
1 parent 0105635 commit 80d128d

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

Runtime/StateMachineGeneric.cs

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,14 +128,21 @@ public StateMachineGeneric<STATE_ID, TSTATE> ForEachState(System.Action<TSTATE>
128128

129129
public StateMachineGeneric<STATE_ID, TSTATE> Clear()
130130
{
131-
_waitQueue.Clear();
132-
_commandQueue.Clear();
131+
ClearQueue();
133132
currentState = null;
134133
_currentStateID = default;
135134

136135
return this;
137136
}
138137

138+
public StateMachineGeneric<STATE_ID, TSTATE> ClearQueue()
139+
{
140+
_waitQueue.Clear();
141+
_commandQueue.Clear();
142+
143+
return this;
144+
}
145+
139146
IEnumerator UpdateCoroutine()
140147
{
141148
while (true)

0 commit comments

Comments
 (0)