using Unity.Collections; public class HarmonyOriginPatches { //[HarmonyPatch(typeof(Origin), nameof(Origin.Awake))] public class AwakePatch { public static bool Prefix(Origin __instance) { Log.Out($"Origin::Awake Prefix"); if (Origin.Instance == null) { Origin.Instance = __instance; } __instance.isAuto = false; __instance.particles = new NativeArray(512, Allocator.Persistent); __instance.physicsCheckT = __instance.transform.GetChild(0); Origin.Instance.Reposition(Vector3.zero); return false; } } //[HarmonyPatch(typeof(Origin), nameof(Origin.FixedUpdate))] public class FixedUpdatePatch { public static bool Prefix(Origin __instance) { if (__instance.isActiveAndEnabled) { Log.Out($"Origin::FixedUpdate - Disabling Origin"); __instance.isAuto = false; __instance.gameObject.SetActive(false); } return false; } } }