diff --git a/Fika.Core/Coop/Utils/NetManagerUtils.cs b/Fika.Core/Coop/Utils/NetManagerUtils.cs index 57e8279c..4a0e540b 100644 --- a/Fika.Core/Coop/Utils/NetManagerUtils.cs +++ b/Fika.Core/Coop/Utils/NetManagerUtils.cs @@ -13,13 +13,18 @@ public static class NetManagerUtils private static ManualLogSource logger = BepInEx.Logging.Logger.CreateLogSource("NetManagerUtils"); public static GameObject FikaGameObject; + public static void CreateFikaGameObject() + { + FikaGameObject = new GameObject("FikaGameObject"); + Object.DontDestroyOnLoad(FikaGameObject); + logger.LogInfo("FikaGameObject has been created!"); + } + public static void CreateNetManager(bool isServer) { if (FikaGameObject == null) { - FikaGameObject = new GameObject("FikaGameObject"); - Object.DontDestroyOnLoad(FikaGameObject); - logger.LogInfo("FikaGameObject has been created!"); + CreateFikaGameObject(); } if (isServer) @@ -40,9 +45,7 @@ public static void CreatePingingClient() { if (FikaGameObject == null) { - FikaGameObject = new GameObject("FikaGameObject"); - Object.DontDestroyOnLoad(FikaGameObject); - logger.LogInfo("FikaGameObject has been created!"); + CreateFikaGameObject(); } FikaPingingClient pingingClient = FikaGameObject.AddComponent();