From fb471754bcef8361883e223e954d8d3c7c1aba56 Mon Sep 17 00:00:00 2001 From: Soraphis Date: Tue, 18 Jul 2023 22:48:06 +0200 Subject: [PATCH] prevents FiniteStateMachineMonoHook singleton from being unloaded (#386) --- .../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;