com.alicizax.unity.framework/Runtime/ObjectPool/IObjectPool.cs

29 lines
755 B
C#
Raw Normal View History

using System;
2025-10-11 15:18:09 +08:00
namespace AlicizaX.ObjectPool
{
public interface IObjectPool<T> where T : ObjectBase
2025-10-11 15:18:09 +08:00
{
string Name { get; }
string FullName { get; }
Type ObjectType { get; }
int Count { get; }
bool AllowMultiSpawn { get; }
float AutoReleaseInterval { get; set; }
int Capacity { get; set; }
float ExpireTime { get; set; }
int Priority { get; set; }
void Register(T obj, bool spawned);
bool CanSpawn();
bool CanSpawn(string name);
T Spawn();
T Spawn(string name);
void Unspawn(T obj);
void Unspawn(object target);
void Release();
void Release(int toReleaseCount);
void ReleaseAllUnused();
}
}