-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathBuildAnywhere.cs
32 lines (29 loc) · 902 Bytes
/
BuildAnywhere.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
using HarmonyLib;
using System.Reflection;
using UnityEngine;
public class BuildAnywhere : Mod
{
private const string ModName = "buildanywhere";
private const string HarmonyId = "com.wisnoski.greenhell." + ModName;
Harmony instance_buildanywhere;
public void Start()
{
instance_buildanywhere = new Harmony(HarmonyId);
instance_buildanywhere.PatchAll(Assembly.GetExecutingAssembly());
Debug.Log(string.Format("Mod {0} has been loaded!", ModName));
}
public void OnModUnload()
{
instance_buildanywhere.UnpatchAll(ModName);
Debug.Log(string.Format("Mod {0} has been unloaded!", ModName));
}
}
[HarmonyPatch(typeof(ConstructionGhost))]
[HarmonyPatch("UpdateProhibitionType")]
internal class Patch_ConstructionGhost
{
static void Postfix(ConstructionGhost __instance)
{
Traverse.Create(__instance).Field("m_ProhibitionType").SetValue(ConstructionGhost.ProhibitionType.None);
}
}