Add backbone for card creation and implement Camera minigame mechanics
This commit is contained in:
@@ -45,7 +45,7 @@ namespace Minigames.DivingForPictures
|
||||
|
||||
// Private fields
|
||||
private Collider2D _collider;
|
||||
private Camera _mainCamera;
|
||||
private UnityEngine.Camera _mainCamera;
|
||||
private float _screenTop;
|
||||
private float _screenBottom; // Added to track bottom of screen
|
||||
private Coroutine _movementCoroutine;
|
||||
@@ -78,7 +78,7 @@ namespace Minigames.DivingForPictures
|
||||
Debug.LogError($"[FloatingObstacle] No Collider2D found on {gameObject.name}!");
|
||||
}
|
||||
|
||||
_mainCamera = Camera.main;
|
||||
_mainCamera = UnityEngine.Camera.main;
|
||||
|
||||
// Get settings
|
||||
_settings = GameManager.GetSettingsObject<IDivingMinigameSettings>();
|
||||
@@ -153,7 +153,7 @@ namespace Minigames.DivingForPictures
|
||||
/// <summary>
|
||||
/// Resume this obstacle's movement and behavior
|
||||
/// </summary>
|
||||
public void Resume()
|
||||
public void DoResume()
|
||||
{
|
||||
if (!_isPaused) return; // Already running
|
||||
|
||||
@@ -168,6 +168,9 @@ namespace Minigames.DivingForPictures
|
||||
/// </summary>
|
||||
private void StartObstacleCoroutines()
|
||||
{
|
||||
if (!isActiveAndEnabled)
|
||||
return;
|
||||
|
||||
if (enableMovement && _movementCoroutine == null)
|
||||
{
|
||||
_movementCoroutine = StartCoroutine(MovementCoroutine());
|
||||
@@ -281,7 +284,7 @@ namespace Minigames.DivingForPictures
|
||||
{
|
||||
if (_mainCamera == null)
|
||||
{
|
||||
_mainCamera = Camera.main;
|
||||
_mainCamera = UnityEngine.Camera.main;
|
||||
if (_mainCamera == null) return;
|
||||
}
|
||||
|
||||
@@ -357,7 +360,7 @@ namespace Minigames.DivingForPictures
|
||||
{
|
||||
// Reset all state first
|
||||
_screenTop = 0f; // Reset cached screen bounds
|
||||
_mainCamera = Camera.main; // Refresh camera reference
|
||||
_mainCamera = UnityEngine.Camera.main; // Refresh camera reference
|
||||
|
||||
// Re-enable the collider for reuse
|
||||
if (_collider != null)
|
||||
|
||||
Reference in New Issue
Block a user