From da7b4ea409211668896a44f3e8408dbb88acb983 Mon Sep 17 00:00:00 2001 From: Soraphis Date: Sun, 29 Jan 2023 21:11:00 +0100 Subject: [PATCH] prevents FiniteStateMachineMonoHook singleton from being unloaded --- .../FSM/Runtime/FiniteStateMachine/FiniteStateMachineMonoHook.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/Packages/FSM/Runtime/FiniteStateMachine/FiniteStateMachineMonoHook.cs b/Packages/FSM/Runtime/FiniteStateMachine/FiniteStateMachineMonoHook.cs index 09ba6f1f..467b184d 100644 --- a/Packages/FSM/Runtime/FiniteStateMachine/FiniteStateMachineMonoHook.cs +++ b/Packages/FSM/Runtime/FiniteStateMachine/FiniteStateMachineMonoHook.cs @@ -14,6 +14,7 @@ namespace UnityAtoms.FSM { GameObject go = new GameObject("FiniteStateMachineUpdateHook"); _instance = go.AddComponent(); + DontDestroyOnLoad(go); } return _instance;