Bunch more networking stuff

This commit is contained in:
2025-02-28 14:35:14 +02:00
parent 1dce1960f6
commit d0eb7f89be
8 changed files with 126 additions and 36 deletions

View File

@@ -115,6 +115,21 @@ namespace BoneSync.Sync.Components
public void OnEnable()
{
FindComponents();
bool shouldAutoSync = CheckIfShouldAutoSync();
if (shouldAutoSync)
{
MelonLogger.Msg("AutoSyncing: " + transform.GetPath());
RegisterSyncable();
}
}
public bool CheckIfShouldAutoSync()
{
if (poolee && poolee.pool) {
return true;
}
return false;
}
public string GetSyncableWorldPath()
@@ -151,14 +166,7 @@ namespace BoneSync.Sync.Components
public bool CanBeSynced()
{
FindComponents();
if (interactableManager && interactableManager.hosts.Count > 0)
{
return true;
}
if (interactableHost && interactableHost.hasRigidbody)
{
return true;
}
if (rigidbodies.Length > 0) return true;
return false;
}