/// <summary> /// Receives a GameObject from objToCreateFrom's object /// pool. /// </summary> /// <param name="objToCreateFrom">The prefab or GameObject that we /// want a duplicated object of.</param> /// <returns>A GameObject from the object pool.</returns> public static GameObject GetObj(GameObject objToCreateFrom) { PoolableGameObject poolable = objToCreateFrom.GetComponent <PoolableGameObject>(); if (poolable == null) { Debug.LogErrorFormat(REQUIRES_COMP, objToCreateFrom.name, "Get"); return(null); } return(poolable.Get().gameObject); }