-
Notifications
You must be signed in to change notification settings - Fork 0
/
Plugin.cs
46 lines (33 loc) · 1.22 KB
/
Plugin.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
using System.IO;
using System.Reflection;
using BepInEx;
using BepInEx.Logging;
using HarmonyLib;
using UnityEngine;
namespace HarHarHarLC
{
[BepInPlugin("kyryh.harharharlc", "Toreador March Jester", "1.0.0")]
public class Plugin : BaseUnityPlugin
{
public static ManualLogSource Log;
public static AssetBundle assetBundle;
private void Awake()
{
Log = Logger;
// Plugin startup logic
Assembly assembly = Assembly.GetExecutingAssembly();
using (Stream stream = assembly.GetManifestResourceStream("HarHarHarLC.Resources.harharharassetbundle")){
assetBundle = AssetBundle.LoadFromStream(stream);
}
Logger.LogInfo($"Plugin {PluginInfo.PLUGIN_GUID} is loaded!");
Harmony harmony = new Harmony("kyryh.harharharlc");
harmony.PatchAll();
}
}
[HarmonyPatch(typeof(JesterAI), "Start")]
class Patch1 {
static public void Postfix(JesterAI __instance) {
__instance.popGoesTheWeaselTheme = Plugin.assetBundle.LoadAsset<AudioClip>("Music_box.wav");
}
}
}