/// <summary> /// Disposes of the request. /// </summary> public void Dispose() { if (m_AssetBundleReference != null) { m_AssetBundleReference.Release(); m_AssetBundleReference = null; } }
/// <example> /// Creates a new AssetBundleLoaderRequest instance. /// </example> /// <param name="assetBundleName"> /// The name of the asset bundle to load. /// </param> public AssetBundleLoaderRequest(string assetBundleName) { AssetBundleReference assetBundleReference; assetBundleReference = AssetBundleReference.FindOrCreateReference(assetBundleName); if (assetBundleReference != null) { m_AssetBundleReference = assetBundleReference; m_AssetBundleReference.Retain(); } }
/// <summary> /// Finds an existing asset bundle reference for the specified asset bundle. /// </summary> /// <param name="assetBundleName"> /// The name of the asset bundle. /// </param> public static AssetBundleReference FindReference(string assetBundleName) { if (string.IsNullOrEmpty(assetBundleName)) { throw new System.ArgumentNullException("assetBundleName"); } if (References.ContainsKey(assetBundleName)) { AssetBundleReference reference = References[assetBundleName]; reference.Retain(); reference.Autorelease(); return(reference); } return(null); }