-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPlugin.cs
More file actions
48 lines (39 loc) · 1.19 KB
/
Plugin.cs
File metadata and controls
48 lines (39 loc) · 1.19 KB
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
47
48
using BepInEx;
using BepInEx.Logging;
using HarmonyLib;
using UnityEngine;
using UnityEngine.UI;
using UnityEngine.Networking;
using System.Collections;
using System.Linq;
using System.Collections.Generic;
using System;
namespace MyFirstPlugin;
[BepInPlugin(MyPluginInfo.PLUGIN_GUID, MyPluginInfo.PLUGIN_NAME, MyPluginInfo.PLUGIN_VERSION)]
[BepInProcess("ULTRAKILL.exe")]
public class Plugin : BaseUnityPlugin
{
internal static ManualLogSource Logger;
private void Awake()
{
Logger = base.Logger;
Logger.LogInfo($"Plugin {MyPluginInfo.PLUGIN_GUID} is loaded!");
var instance = new Harmony(MyPluginInfo.PLUGIN_GUID);
instance.PatchAll(typeof(Patches));
}
}
public static class Patches
{
[HarmonyPatch(typeof(ShopZone), "Start")]
[HarmonyPostfix]
static void Hook(ShopZone __instance)
{
Doom d = __instance.gameObject.AddComponent<Doom>();
d.tickTime = 0.028571f;
d.wadPath = "./BepInEx/plugins/doom/DOOM.WAD";
string pwad = "./BepInEx/plugins/doom/ultradoom.wad";
d.pwadPath = System.IO.File.Exists(pwad) ? pwad : "";
d.sfPath = "./BepInEx/plugins/doom/RLNDGM.SF2";
d.SetUp();
}
}