public void ReturnObjectToPool(GameObject go)
{
PoolObject po = go.GetComponent<PoolObject>();
if (po == null)
{
#if UNITY_EDITOR
Debug.LogWarning("Specified object is not a pooled instance: " + go.name);
#endif
}
else
{
Pool pool = null;
if (poolDict.TryGetValue(po.poolName, out pool))
{
pool.ReturnObjectToPool(po);
}
#if UNITY_EDITOR
else
{
Debug.LogWarning("No pool available with name: " + po.poolName);
}
#endif
}
}