Add backbone for card creation and implement Camera minigame mechanics
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
using System.Collections;
|
||||
using UnityEngine;
|
||||
using Pooling;
|
||||
using AppleHills.Core.Settings;
|
||||
using AppleHills.Core.Interfaces;
|
||||
|
||||
@@ -20,7 +19,7 @@ namespace Minigames.DivingForPictures
|
||||
private float _timer;
|
||||
private float _nextSpawnInterval;
|
||||
private BubblePool _bubblePool;
|
||||
private Camera _mainCamera; // Cache camera reference
|
||||
private UnityEngine.Camera _mainCamera; // Cache camera reference
|
||||
private bool _isSurfacing = false;
|
||||
|
||||
// Pause state
|
||||
@@ -34,7 +33,7 @@ namespace Minigames.DivingForPictures
|
||||
|
||||
void Awake()
|
||||
{
|
||||
_mainCamera = Camera.main;
|
||||
_mainCamera = UnityEngine.Camera.main;
|
||||
|
||||
// Get developer settings and game settings
|
||||
_devSettings = GameManager.GetDeveloperSettings<DivingDeveloperSettings>();
|
||||
@@ -67,12 +66,7 @@ namespace Minigames.DivingForPictures
|
||||
|
||||
void Start()
|
||||
{
|
||||
// Register with DivingGameManager for pause/resume events
|
||||
DivingGameManager gameManager = FindFirstObjectByType<DivingGameManager>();
|
||||
if (gameManager != null)
|
||||
{
|
||||
gameManager.RegisterPausableComponent(this);
|
||||
}
|
||||
DivingGameManager.Instance.RegisterPausableComponent(this);
|
||||
|
||||
// Start spawning if not paused
|
||||
StartSpawningCoroutine();
|
||||
@@ -80,12 +74,7 @@ namespace Minigames.DivingForPictures
|
||||
|
||||
void OnDestroy()
|
||||
{
|
||||
// Unregister from DivingGameManager
|
||||
DivingGameManager gameManager = FindFirstObjectByType<DivingGameManager>();
|
||||
if (gameManager != null)
|
||||
{
|
||||
gameManager.UnregisterPausableComponent(this);
|
||||
}
|
||||
DivingGameManager.Instance.UnregisterPausableComponent(this);
|
||||
|
||||
// Clean up any active coroutines
|
||||
StopAllCoroutines();
|
||||
@@ -123,7 +112,7 @@ namespace Minigames.DivingForPictures
|
||||
/// <summary>
|
||||
/// Resumes the bubble spawner and all bubbles
|
||||
/// </summary>
|
||||
public void Resume()
|
||||
public void DoResume()
|
||||
{
|
||||
if (!_isPaused) return; // Already running
|
||||
|
||||
@@ -138,7 +127,7 @@ namespace Minigames.DivingForPictures
|
||||
{
|
||||
if (bubble != null)
|
||||
{
|
||||
bubble.Resume();
|
||||
bubble.DoResume();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user