Move around scripts to cleanup the Minigame structure

This commit is contained in:
2025-09-22 14:50:48 +02:00
parent 96aad806a9
commit da07f778c3
45 changed files with 17 additions and 17 deletions

View File

@@ -0,0 +1,42 @@
using UnityEngine;
using Pooling;
namespace Minigames.DivingForPictures
{
/// <summary>
/// Manages a pool of bubble objects to reduce garbage collection overhead.
/// </summary>
public class BubblePool : BaseObjectPool<Bubble>
{
/// <summary>
/// Gets a bubble from the pool, or creates a new one if the pool is empty
/// </summary>
/// <returns>A bubble instance ready to use</returns>
public Bubble GetBubble()
{
Bubble bubble = Get();
// Set reference to this pool so the bubble can return itself
bubble.SetPool(this);
return bubble;
}
/// <summary>
/// Returns a bubble to the pool
/// </summary>
/// <param name="bubble">The bubble to return to the pool</param>
public void ReturnBubble(Bubble bubble)
{
Return(bubble);
}
/// <summary>
/// Logs pool statistics
/// </summary>
public override void LogPoolStats()
{
Debug.Log($"[BubblePool] Pooled bubbles: {pooledObjects.Count}/{maxPoolSize} (Created: {totalCreated}, Returned: {totalReturned})");
}
}
}