Working generic object pooling, pool monitor editor tool and batch component adder editor tool
This commit is contained in:
21
Assets/Scripts/Pooling/IPoolable.cs
Normal file
21
Assets/Scripts/Pooling/IPoolable.cs
Normal file
@@ -0,0 +1,21 @@
|
||||
namespace Pooling
|
||||
{
|
||||
/// <summary>
|
||||
/// Interface for objects that can be pooled.
|
||||
/// Implement this interface on any component that should be managed by an ObjectPool.
|
||||
/// </summary>
|
||||
public interface IPoolable
|
||||
{
|
||||
/// <summary>
|
||||
/// Called when the object is retrieved from the pool.
|
||||
/// Use this to reset the object's state.
|
||||
/// </summary>
|
||||
void OnSpawn();
|
||||
|
||||
/// <summary>
|
||||
/// Called when the object is returned to the pool.
|
||||
/// Use this to clean up any resources or state.
|
||||
/// </summary>
|
||||
void OnDespawn();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user