Working generic object pooling, pool monitor editor tool and batch component adder editor tool
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using UnityEngine;
|
||||
using Pooling;
|
||||
|
||||
namespace Minigames.DivingForPictures
|
||||
{
|
||||
@@ -43,6 +44,11 @@ namespace Minigames.DivingForPictures
|
||||
_bubblePool.initialPoolSize = initialPoolSize;
|
||||
_bubblePool.maxPoolSize = maxPoolSize;
|
||||
_bubblePool.Initialize(bubblePrefab);
|
||||
|
||||
// Periodically check for pool statistics in debug builds
|
||||
#if DEVELOPMENT_BUILD || UNITY_EDITOR
|
||||
InvokeRepeating(nameof(LogPoolStats), 5f, 30f);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
@@ -112,5 +118,16 @@ namespace Minigames.DivingForPictures
|
||||
// Pass min/max scale for wobble clamping
|
||||
bubble.SetWobbleScaleLimits(wobbleMinScale, wobbleMaxScale);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Logs the current pool statistics for debugging
|
||||
/// </summary>
|
||||
private void LogPoolStats()
|
||||
{
|
||||
if (_bubblePool != null)
|
||||
{
|
||||
_bubblePool.LogPoolStats();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user