using System;
using System.Collections;
using System.Collections.Generic;
namespace asap.core.common
{
public interface IObjectPool
{
// string PoolId { get; }
Type ObjectType { get; }
int PoolObjectNum { get; }
object SpawnObject();
///
///
///
///
/// 无效参数
///
bool DespawnObject(object obj, float delay = 0f);
void Initialize();
void Release();
}
// public interface IObjectPool : IObjectPool where T : class
// {
// new T SpawnObject();
// void DespawnObject(T obj);
// }
public interface IPoolableObject
{
void OnSpawn();
void OnDespawn();
void OnPoolCreate(IObjectPool objectPool);
//void Destroy();
void OnPoolDestroy();
void ReturnPool();
}
public abstract class AObjectPool : IObjectPool
{
protected Queue