private void DoDespawn(GameObject obj) { PoolInstance inst; if (poolInstances.TryGetValue(obj, out inst)) { PoolTable table = inst.Table; if (table != null) { inst.InUse = false; table.Despawn(obj); enabled = true; return; } } //Debug.LogError("Could not find obj to despawn in pool: " + obj.name); GameObject.Destroy(obj); }
private void InternalDespawn(GameObject obj) { PoolInstance ins; if (poolInstances.TryGetValue(obj, out ins)) { PoolTable table = ins.Table; if (table != null) { ins.InUse = false; table.Despawn(obj); return; } } #if DEBUG Debug.LogWarning("Cannot find any " + obj.name + " in pool to despawn"); #endif Destroy(obj); }