Unity3d-Finite-State-Machine
Unity3d-Finite-State-Machine copied to clipboard
StateMachine.Driver is null after unity hot code reload
Hi! So let's say I have a default state machine:
protected StateMachine<States> fsm;
and in Update()
I call fsm.Driver.Update.Invoke();
void Update() {
fsm.Driver.Update.Invoke();
}
It works well, but it looks like that Driver field is not preserved after a code reload while the game is running
NullReferenceException: Object reference not set to an instance of an object
QT.Entity.Update () (at Script.cs:137)
Is this an expected behaviour, or am I using it wrong? If it is expected, is there a way we could preserve that field between reloads?