32 lines
660 B
C#
32 lines
660 B
C#
using System;
|
|
using System.Reflection;
|
|
using HarmonyLib;
|
|
using UnityModManagerNet;
|
|
|
|
namespace MOD_NAME;
|
|
|
|
public static class Main
|
|
{
|
|
// Unity Mod Manage Wiki: https://wiki.nexusmods.com/index.php/Category:Unity_Mod_Manager
|
|
private static bool Load(UnityModManager.ModEntry modEntry)
|
|
{
|
|
Harmony? harmony = null;
|
|
|
|
try
|
|
{
|
|
harmony = new Harmony(modEntry.Info.Id);
|
|
harmony.PatchAll(Assembly.GetExecutingAssembly());
|
|
|
|
// Other plugin startup logic
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
modEntry.Logger.LogException($"Failed to load {modEntry.Info.DisplayName}:", ex);
|
|
harmony?.UnpatchAll(modEntry.Info.Id);
|
|
return false;
|
|
}
|
|
|
|
return true;
|
|
}
|
|
}
|