Fix pausing etc. issues in the minigame
This commit is contained in:
@@ -42,15 +42,12 @@ namespace Minigames.DivingForPictures.Player
|
||||
Debug.LogError("[PlayerController] Failed to load diving minigame settings!");
|
||||
}
|
||||
}
|
||||
|
||||
void OnEnable()
|
||||
{
|
||||
// Register as a pausable component with DivingGameManager
|
||||
DivingGameManager.Instance.RegisterPausableComponent(this);
|
||||
}
|
||||
|
||||
void Start()
|
||||
{
|
||||
// Register as a pausable component with DivingGameManager
|
||||
DivingGameManager.Instance.RegisterPausableComponent(this);
|
||||
|
||||
// Initialize target to current position
|
||||
targetFingerX = transform.position.x;
|
||||
isTouchActive = false;
|
||||
@@ -114,10 +111,11 @@ namespace Minigames.DivingForPictures.Player
|
||||
|
||||
private void OnDestroy()
|
||||
{
|
||||
DivingGameManager.Instance.OnGameInitialized -= Initialize;
|
||||
|
||||
// Unregister as a pausable component
|
||||
DivingGameManager.Instance.UnregisterPausableComponent(this);
|
||||
if (DivingGameManager.Instance)
|
||||
{
|
||||
DivingGameManager.Instance.OnGameInitialized -= Initialize;
|
||||
DivingGameManager.Instance.UnregisterPausableComponent(this);
|
||||
}
|
||||
|
||||
// Unsubscribe from edge anchor events
|
||||
if (edgeAnchor != null)
|
||||
|
||||
Reference in New Issue
Block a user