diff --git a/PrefabManager.cs b/PrefabManager.cs index ad5e1c1..f636173 100644 --- a/PrefabManager.cs +++ b/PrefabManager.cs @@ -20,16 +20,19 @@ namespace KCM public static GameObject modalUIPrefab; - public void PreScriptLoad(KCModHelper _helper) + public static void PreScriptLoad(KCModHelper _helper) { - try + helper = _helper; + if (helper == null) { - //Main.helper = _helper; + helper = Main.instance.helper; + } - assetBundle = KCModHelper.LoadAssetBundle(_helper.modPath, "serverbrowserpkg"); + var assetBundle = helper.LoadAssetBundle(helper.modPath, "serverbrowserpkg"); + + if (assetBundle == null) + { - if (assetBundle == null) - { Main.helper.Log("ERROR: Asset bundle 'serverbrowserpkg' not found! UI features will not work."); Main.helper.Log("Please ensure the asset bundle file is in the mod directory."); return;