/// <summary> /// Includes a previously excluded object in the pool. /// </summary> /// <param name="game_object"></param> public void IncludePooledObject(GameObject game_object) { if (!ExcludedPoolTable.Contains(game_object)) { return; } ExcludedPoolTable.Remove(game_object); PoolTable.Add(game_object); }
// -- PRIVATE // .. OPERATIONS GameObject CreateNewObject() { GameObject new_game_object; new_game_object = (GameObject)GameObject.Instantiate(PrefabToClone); new_game_object.SetActive(false); new_game_object.GetComponent <Transform>().SetParent(GetComponent <Transform>(), false); PoolTable.Add(new_game_object); return(new_game_object); }