public GameObject GetTrap(Enums.Traps type) { IPoolable entity = AllocateEntity(trapPools[(int)type]); if (entity == null) { return(null); } return(entity.GetGameObject()); }
public void ReturnTrap(Enums.Traps type, GameObject trap) { IPoolable entity = trap.GetComponent <IPoolable>(); DeallocateEntity(trapPools[(int)type], entity); }