mirror of
https://github.com/NotAKidoS/NAK_CVR_Mods.git
synced 2025-09-04 23:39:22 +00:00
[RelativeSync] add support for YouAreMyPropNowWeAreHavingSoftTacosLaterMod
This commit is contained in:
parent
63948ddf69
commit
47b69dfbc7
1 changed files with 32 additions and 22 deletions
|
@ -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++)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue