mirror of
https://github.com/MaddyThorson/StrawberryBF.git
synced 2025-02-18 11:38:28 +08:00
StateMachine error check
This commit is contained in:
parent
9bad58cf2d
commit
4daafca0b7
@ -56,6 +56,8 @@ namespace Strawberry
|
|||||||
|
|
||||||
private Result<bool> Set(TIndex to)
|
private Result<bool> Set(TIndex to)
|
||||||
{
|
{
|
||||||
|
if (!states.ContainsKey(to))
|
||||||
|
Runtime.FatalError("State does not exist in this State Machine. Call Add() first!");
|
||||||
if (inStateCall)
|
if (inStateCall)
|
||||||
Runtime.FatalError("Cannot set State directly from inside a State Enter/Exit/Update call. Return the desired State change instead.");
|
Runtime.FatalError("Cannot set State directly from inside a State Enter/Exit/Update call. Return the desired State change instead.");
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user