[RelativeSync] add support for YouAreMyPropNowWeAreHavingSoftTacosLaterMod

This commit is contained in:
NotAKidoS 2025-04-12 17:01:24 -05:00
parent 63948ddf69
commit 47b69dfbc7

View file

@ -21,6 +21,23 @@ public class RelativeSyncMarker : MonoBehaviour
private void Start()
{
RegisterWithManager();
ConfigureForPotentialMovementParent();
}
private void OnDestroy()
{
RelativeSyncManager.RelativeSyncTransforms.Remove(pathHash);
}
public void OnHavingSoftTacosNow()
=> RegisterWithManager();
private void RegisterWithManager()
{
// Remove old hash in case this is a re-registration
RelativeSyncManager.RelativeSyncTransforms.Remove(pathHash);
string path = GetGameObjectPath(transform);
int hash = path.GetHashCode();
@ -37,13 +54,6 @@ public class RelativeSyncMarker : MonoBehaviour
pathHash = hash;
RelativeSyncManager.RelativeSyncTransforms.Add(hash, this);
ConfigureForPotentialMovementParent();
}
private void OnDestroy()
{
RelativeSyncManager.RelativeSyncTransforms.Remove(pathHash);
}
private void ConfigureForPotentialMovementParent()
@ -86,7 +96,7 @@ public class RelativeSyncMarker : MonoBehaviour
return path;
}
private bool FindAvailableHash(ref int hash)
private static bool FindAvailableHash(ref int hash)
{
for (int i = 0; i < 16; i++)
{