Cleanup compile warnings, cleanup logs, spruce up level selection menu

This commit is contained in:
Michal Pikulski
2025-10-28 14:31:17 +01:00
parent a5b1a4f8a0
commit 43779c560e
67 changed files with 4814 additions and 1050 deletions

View File

@@ -1,12 +1,11 @@
using System;
using System.Collections;
using UnityEngine;
using AppleHills.Core.Settings;
using System.Collections;
using AppleHills.Core.Interfaces;
using AppleHills.Core.Settings;
using Core;
using UnityEngine;
using Random = UnityEngine.Random;
namespace Minigames.DivingForPictures
namespace Minigames.DivingForPictures.Bubbles
{
/// <summary>
/// Spawns bubbles at intervals, randomizing their properties and assigning a random sprite to each.
@@ -45,9 +44,9 @@ namespace Minigames.DivingForPictures
if (_devSettings.BubbleUseObjectPooling)
{
// Create the bubble pool
GameObject poolGO = new GameObject("BubblePool");
poolGO.transform.SetParent(transform);
_bubblePool = poolGO.AddComponent<BubblePool>();
GameObject poolGo = new GameObject("BubblePool");
poolGo.transform.SetParent(transform);
_bubblePool = poolGo.AddComponent<BubblePool>();
_bubblePool.initialPoolSize = _devSettings.BubbleInitialPoolSize;
_bubblePool.maxPoolSize = _devSettings.BubbleMaxPoolSize;
_bubblePool.Initialize(bubblePrefab);
@@ -89,7 +88,7 @@ namespace Minigames.DivingForPictures
}
// Pause all active bubbles
Bubble[] activeBubbles = FindObjectsOfType<Bubble>();
Bubble[] activeBubbles = FindObjectsByType<Bubble>(FindObjectsSortMode.None);
foreach (var bubble in activeBubbles)
{
if (bubble != null)
@@ -110,7 +109,7 @@ namespace Minigames.DivingForPictures
StartSpawningCoroutine();
// Resume all active bubbles
Bubble[] activeBubbles = FindObjectsOfType<Bubble>();
Bubble[] activeBubbles = FindObjectsByType<Bubble>(FindObjectsSortMode.None);
foreach (var bubble in activeBubbles)
{
if (bubble != null)

View File

@@ -8,6 +8,7 @@ using System;
using System.Collections;
using System.Collections.Generic;
using Bootstrap;
using Minigames.DivingForPictures.Bubbles;
using UI;
using UI.Core;
using UnityEngine;
@@ -97,7 +98,6 @@ namespace Minigames.DivingForPictures
public event Action<Monster, float> OnPhotoSequenceCompleted; // Now includes proximity score
private static DivingGameManager _instance = null;
private static bool _isQuitting = false;
public AudioSource deathAudioPlayer;
public CameraViewfinderManager cameraViewfinderManager;
@@ -122,11 +122,6 @@ namespace Minigames.DivingForPictures
_isGameOver = false;
}
private void OnApplicationQuit()
{
_isQuitting = true;
}
private void Start()
{
// Register for post-boot initialization

View File

@@ -15,13 +15,11 @@ namespace Minigames.DivingForPictures.PictureCamera
{
// Singleton instance
private static CameraViewfinderManager _instance;
private static bool _isQuitting = false;
public static CameraViewfinderManager Instance
{
get
{
if (_instance == null && Application.isPlaying && !_isQuitting)
if (_instance == null && Application.isPlaying)
{
_instance = FindAnyObjectByType<CameraViewfinderManager>();
if (_instance == null)
@@ -89,11 +87,6 @@ namespace Minigames.DivingForPictures.PictureCamera
}
}
private void OnApplicationQuit()
{
_isQuitting = true;
}
private void Start()
{
settings = GameManager.GetSettingsObject<IDivingMinigameSettings>();

View File

@@ -11,7 +11,6 @@ namespace Minigames.DivingForPictures
/// </summary>
public class TileBumpCollision : PlayerCollisionBehavior
{
private bool _isBumping;
private Coroutine _bumpCoroutine;
protected override void HandleCollisionResponse(Collider2D obstacle)
@@ -98,8 +97,6 @@ namespace Minigames.DivingForPictures
_bumpCoroutine = null;
}
_isBumping = true;
// Start bump coroutine
_bumpCoroutine = StartCoroutine(BumpCoroutine(startX, targetX, duration));
}
@@ -142,7 +139,6 @@ namespace Minigames.DivingForPictures
}
// Bump finished
_isBumping = false;
_bumpCoroutine = null;
Logging.Debug("[TileBumpCollision] Bump movement completed");

View File

@@ -73,9 +73,6 @@ namespace Minigames.DivingForPictures
// Screen normalization
private float _screenNormalizationFactor = 1.0f;
// Tracks if a floating area in the middle is currently active
private bool isFloatingAreaActive = false;
// Current depth of the trench
private int _currentDepth = 0;
@@ -714,20 +711,6 @@ namespace Minigames.DivingForPictures
_currentDepth++;
Logging.Debug($"[TrenchTileSpawner] Current Depth: {_currentDepth}");
onTileSpawned?.Invoke(tile);
// --- FLOATING AREA STATE MANAGEMENT ---
Tile spawnedTile = tile.GetComponent<Tile>();
if (spawnedTile != null)
{
if (spawnedTile.hasFloatingAreaMiddle || spawnedTile.continuesFloatingAreaMiddle)
{
isFloatingAreaActive = true;
}
if (spawnedTile.endsFloatingAreaMiddle)
{
isFloatingAreaActive = false;
}
}
}
/// <summary>
@@ -776,19 +759,6 @@ namespace Minigames.DivingForPictures
_currentDepth++;
Logging.Debug($"[TrenchTileSpawner] Current Depth: {_currentDepth}");
onTileSpawned?.Invoke(tile);
// Optionally update floating area state if needed
Tile spawnedTile = tile.GetComponent<Tile>();
if (spawnedTile != null)
{
if (spawnedTile.hasFloatingAreaMiddle || spawnedTile.continuesFloatingAreaMiddle)
{
isFloatingAreaActive = true;
}
if (spawnedTile.endsFloatingAreaMiddle)
{
isFloatingAreaActive = false;
}
}
}
/// <summary>