From c11256f9a12bb54b500e59e4f3d26588e86cd4fb Mon Sep 17 00:00:00 2001 From: Aaro Varis Date: Sun, 2 Mar 2025 18:15:49 +0200 Subject: [PATCH] aaa --- BoneSync/Sync/Components/SyncableBase.cs | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/BoneSync/Sync/Components/SyncableBase.cs b/BoneSync/Sync/Components/SyncableBase.cs index 6bb5145..2636c14 100644 --- a/BoneSync/Sync/Components/SyncableBase.cs +++ b/BoneSync/Sync/Components/SyncableBase.cs @@ -199,6 +199,16 @@ namespace BoneSync.Sync.Components return false; } + + private IEnumerator DespawnSyncable() + { + for (int i = 0; i < 3; i++) + { + gameObject?.SetActive(false); + yield return null; + } + yield break; + } private void _DiscardSyncable(bool force, bool despawn) { @@ -226,10 +236,7 @@ namespace BoneSync.Sync.Components DestroyImmediate(this); // delete the component - if (despawn) - { - gameObject?.SetActive(false); - } + if (despawn) MelonCoroutines.Start(DespawnSyncable()); } private void OnRegister()