public static void Create() { if (doesInstanceExist) { return; } GameObject newObject = new GameObject { name = "Necropolis Mod Manager" }; try { newObject.AddComponent <DiscordManager>(); multiplayerManager = newObject.AddComponent <ATMultiplayerManager>(); NecroHooks.postNetworkSetup += multiplayerManager.Init; newObject.AddComponent <ATAPIManager>(); } catch (System.Exception e) { Debug.LogError(e); } DontDestroyOnLoad(newObject); //Patch all CSV's. CSVPatcher.PatchCSVs(); //Load DLL mods. ATModManager.LoadMods(); }
/* * public void UpdateMods() { * foreach( ATMod mod in ATModManager.loadedMods ) { * try { * mod.Update(); * } catch( System.Exception e ) { * DebugConsole.LogError( e.ToString() ); * } * } * } */ /* * public void OnGUI() { * int id = 1; * * if( debugConsole != null && debugConsole.mode != DebugConsole.WindowMode.Hidden ) { * * ATGUIManager.OnGUI(); * * foreach( ATMod mod in ATModManager.loadedMods ) { * * if( !mod.hasGUI ) { * id++; * continue; * } * * try { * mod.guiWindowProperties.RunGUICode( baseID + id, mod.name ); * } catch( System.Exception e ) { * DebugConsole.Log( e.ToString() ); * } * } * * } * * }*/ public void OnApplicationQuit() { /* * foreach( ATMod mod in ATModManager.loadedMods ) { * mod.OnApplicationExit(); * }*/ CSVPatcher.RestoreDefaultCSVs(); }
public static void Create() { if (doesInstanceExist) { return; } GameObject newObject = new GameObject { name = "Necropolis Mod Manager" }; try { newObject.AddComponent <DiscordManager>(); multiplayerManager = newObject.AddComponent <ATMultiplayerManager>(); NecroHooks.postNetworkSetup += multiplayerManager.Init; newObject.AddComponent <ATAPIManager>(); } catch (System.Exception e) { Debug.LogError(e); } DontDestroyOnLoad(newObject); //Import Asset Bundles //AssetImporting.Import(); /* * var myLoadedAssetBundle = AssetBundle.LoadFromFile(Path.Combine(Application.streamingAssetsPath, "AssetBundles/Windows/starwars")); * myLoadedAssetBundle.Unload(false); * * try * { * PrefabManifest * LazySingletonBehavior<patch_PrefabManager>.Instance.CachePrefabProxy<GameObject>("eq-weapon-shortsword-bb8", myLoadedAssetBundle.LoadAsset<GameObject>("eq-weapon-shortsword-bb8")); * } * catch(Exception e) * { * Debug.Log("MODDED ASSET BUNDLE FAILED- " + e); * } */ //Patch all CSV's. CSVPatcher.PatchCSVs(); //Load DLL mods. // ATModManager.LoadMods(); }