/// <summary> /// Gets an object from the pool /// If the pool does not exist it will be created /// </summary> /// <param name="template">Object to get</param> /// <param name="position">Position of object in local space</param> /// <param name="rotation">Rotation of object in local space</param> /// <param name="parent">Object to set as the parent</param> /// <returns>A clone of the object requested</returns> public GameObject Get(GameObject template, Vector3 position, Quaternion rotation, Transform parent, bool setActive = true) { GObjectPool pool = GetOrCreatePool(template); GameObject obj = pool.Get(position, rotation, parent, setActive); return(obj); }
/// <summary> /// Gets an object from the pool /// If the pool does not exist it will be created /// </summary> /// <param name="template">Object to get</param> /// <returns>A clone of the object requested</returns> public GameObject Get(GameObject template, bool setActive = true) { GObjectPool pool = GetOrCreatePool(template); GameObject obj = pool.Get(setActive); return(obj); }