Fix pausing etc. issues in the minigame
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user