void Awake() { this.repositoryUrl = "https://github.com/Conqu3red/Template-Mod/"; // repo to check for updates from if (instance == null) { instance = this; } // Use this if you wish to make the mod trigger cheat mode ingame. // Set this true if your mod effects physics or allows mods that you can't normally do. isCheat = false; modEnabled = Config.Bind("Template Mod", "modEnabled", true, "Enable Mod"); modEnabled.SettingChanged += onEnableDisable; harmony = new Harmony("org.bepinex.plugins.TemplateMod"); harmony.PatchAll(Assembly.GetExecutingAssembly()); this.authors = new string[] { "Conqu3red" }; // just a log statement Logger.LogInfo("aaa"); PolyTechMain.registerMod(this); }
public override void Unload() { Instance = null; TileFileManager = null; ToolBarServiceManager = null; GUIManager.Unload(); GUIManager = null; ResourcesLoader.Unload(); }
public GUIManager(TemplateMod mod) { _mod = mod; _toolBarInterface = new UserInterface(); _toolBarState = new ToolBarState(); _toolBarInterface.SetState(_toolBarState); foreach (var type in typeof(TemplateUIState).GetEnumValues()) { _canShowUITable.Add((TemplateUIState)type, false); } _cdInterface = new CDInterfaceManager(); SetWindows(); }
public TemplateMod() { Instance = this; // MOD的初始化函数,用来设置一些属性 // 注意,这跟Load() 函数不一样 Properties = new ModProperties() { // 自动加载贴图什么的 Autoload = true, // 自动加载血块贴图 AutoloadGores = true, // 自动加载声音文件 AutoloadSounds = true, // 自动加载背景图片 AutoloadBackgrounds = true }; // 以上这些了解一下就行了,每个mod都要有这个 }
public void Unload() { _mod = null; }