[OriginShift] Nuke OriginShiftSpawnableReceiver

This commit is contained in:
NotAKidoS 2024-06-18 16:14:41 -05:00
parent 512ffe38b8
commit 373a60a9d9
3 changed files with 3 additions and 19 deletions

View file

@ -28,7 +28,6 @@ namespace NAK.OriginShift
_characterController = GetComponent<BetterBetterCharacterController>();
#endif
OriginShiftManager.OnPostOriginShifted += OnPostOriginShifted;
StartCoroutine(FixedUpdateCoroutine());
}
private void OnDestroy()
@ -37,7 +36,7 @@ namespace NAK.OriginShift
StopAllCoroutines();
}
private void LateFixedUpdate()
private void Update()
{
// in CVR use GetPlayerPosition to account for VR offset
Vector3 position = PlayerSetup.Instance.GetPlayerPosition();
@ -73,21 +72,5 @@ namespace NAK.OriginShift
}
#endregion Origin Shift Events
#region LateFixedUpdate Implementation
private readonly YieldInstruction _fixedUpdateYield = new WaitForFixedUpdate();
private IEnumerator FixedUpdateCoroutine()
{
while (true)
{
yield return _fixedUpdateYield;
LateFixedUpdate(); // we need to run after all physics (specifically, character controller)
}
// ReSharper disable once IteratorNeverReturns
}
#endregion LateFixedUpdate Implementation
}
}

View file

@ -63,7 +63,7 @@ internal static class CVRSpawnablePatches
[HarmonyPatch(typeof(CVRSpawnable), nameof(CVRSpawnable.Start))]
private static void Postfix_CVRSpawnable_Start(ref CVRSpawnable __instance)
{
__instance.AddComponentIfMissing<OriginShiftSpawnableReceiver>();
//__instance.AddComponentIfMissing<OriginShiftSpawnableReceiver>(); //todo: investigate if this is needed
// test adding to the wrapper of the spawnable
Transform wrapper = __instance.transform.parent;

View file

@ -21,6 +21,7 @@ Experimental mod that allows world origin to be shifted to prevent floating poin
## Mod Incompatibilities
- PlayerRagdollMod will freak out when you ragdoll between chunk boundaries.
- Partial conflict with RelativeSyncs experimental Spawnable Sync Fix.
---