-
Notifications
You must be signed in to change notification settings - Fork 0
/
Patcher.cs
39 lines (32 loc) · 1.03 KB
/
Patcher.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
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text;
using HarmonyLib;
using UnityEngine;
namespace ParkingLotSnapping
{
class Patcher
{
private const string HarmonyId = "yenyang.ParkingLotSnapping";
private static bool patched = false;
public static void PatchAll()
{
if (patched) return;
patched = true;
var harmony = new Harmony(HarmonyId);
//harmony.PatchAll(typeof(Patcher).GetType().Assembly);
//var assembly = Assembly.GetExecutingAssembly();
harmony.PatchAll();
//Debug.Log("[RF].Patcher.PatchAll getPatchedMethods = " + harmony.GetPatchedMethods().ToString());
}
public static void UnpatchAll()
{
if (!patched) return;
var harmony = new Harmony(HarmonyId);
harmony.UnpatchAll(HarmonyId);
patched = false;
}
}
}