Fix pausing etc. issues in the minigame

This commit is contained in:
Michal Pikulski
2025-10-17 13:18:33 +02:00
parent 78fad26ff5
commit 74339d7c47
11 changed files with 43 additions and 74 deletions

View File

@@ -66,21 +66,17 @@ namespace Minigames.DivingForPictures
SetNextSpawnInterval();
}
private void OnEnable()
{
DivingGameManager.Instance.RegisterPausableComponent(this);
}
void Start()
{
// Start spawning if not paused
DivingGameManager.Instance.RegisterPausableComponent(this);
StartSpawningCoroutine();
}
void OnDestroy()
{
DivingGameManager.Instance.UnregisterPausableComponent(this);
DivingGameManager.Instance?.UnregisterPausableComponent(this);
// Clean up any active coroutines
StopAllCoroutines();