add project files

This commit is contained in:
Boris Nikolaev
2026-08-14 01:58:31 +03:00
parent 9134cad79b
commit 5f1e94b653
4399 changed files with 12286903 additions and 0 deletions
@@ -0,0 +1,45 @@
using UnityEngine;
namespace OHM.UnityToolkit.Pooling
{
public class PooledObject : MonoBehaviour
{
private int poolId;
private bool _used;
public int PoolId => poolId;
public bool Used => _used;
public void Use()
{
_used = true;
}
public void Release()
{
_used = false;
}
public void AddToPool(int poolId)
{
this.poolId = poolId;
}
public void RemoveFromPool()
{
poolId = -1;
}
private void OnDestroy()
{
if (poolId != -1)
{
Debug.LogWarning("Pooled object " + base.name
+ "destroyed whereas not ready. You should not destroy a pooled , but use the PoolsManager");
}
}
}
}