Files
Nathaniel Cosford 062dfab2cd Patched
2025-05-30 01:04:40 +09:30

42 lines
1.1 KiB
C#

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<ParticleSystem.Particle>(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;
}
}
}