/// <summary> /// For sending back the instance. /// </summary> /// <param name="go"></param> public void ReturnInstance(GameObject go) { if (!allUsedMap.ContainsKey(go)) { //Debug.Log("GameObject is not a part of the pool: " + go); return; } IPoolEntry pe = allUsedMap[go]; pe.ReturnInstance(go); }
/// <summary> /// Spawn an instantiated object. /// Search by name for the object. /// </summary> /// <param name="name"></param> /// <returns></returns> public GameObject GetInstance(string name) { if (!stringMap.ContainsKey(name)) { Debug.Log("The name is not a part of the pool: " + name); return(null); } IPoolEntry pe = stringMap[name]; GameObject go = pe.GetInstance(); return(go); }