mirror of
https://github.com/misternebula/quantum-space-buddies.git
synced 2025-01-01 03:32:38 +00:00
document rigidbody patches
This commit is contained in:
parent
6e042665cf
commit
2a43480f36
@ -24,7 +24,7 @@ public static class DeterministicManager
|
|||||||
|
|
||||||
if (!_patched)
|
if (!_patched)
|
||||||
{
|
{
|
||||||
_harmony.PatchAll(typeof(OWRigidbodyPatches));
|
_harmony.PatchAll(typeof(DeterministicRigidbodyPatches));
|
||||||
_patched = true;
|
_patched = true;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -4,9 +4,16 @@ using UnityEngine;
|
|||||||
|
|
||||||
namespace QSB.Utility.Deterministic;
|
namespace QSB.Utility.Deterministic;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// used to capture the true path of a rigidbody before it unparents
|
||||||
|
/// </summary>
|
||||||
[HarmonyPatch(typeof(OWRigidbody))]
|
[HarmonyPatch(typeof(OWRigidbody))]
|
||||||
public static class OWRigidbodyPatches
|
public static class DeterministicRigidbodyPatches
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// changing the parent has to be deferred until Start to preserve the sibling index.
|
||||||
|
/// for example, anglerfish bodies all share the same parent, so unparenting one clobbers the sibling index of all the others.
|
||||||
|
/// </summary>
|
||||||
private static readonly Dictionary<OWRigidbody, Transform> _setParentQueue = new();
|
private static readonly Dictionary<OWRigidbody, Transform> _setParentQueue = new();
|
||||||
|
|
||||||
[HarmonyPrefix]
|
[HarmonyPrefix]
|
Loading…
Reference in New Issue
Block a user