/// <summary> /// Checks if an asset is loaded. /// </summary> /// <param name="assetName">The name of the asset to look for.</param> /// <param name="asset">When this method returns true, contains the asset instance.</param> /// <param name="level">When this method returns true, contains the asset's <see cref="ContentLevel"/>.</param> /// <returns>True if the asset is loaded; otherwise false.</returns> bool IsAssetLoaded(string assetName, out IMyLazyAsset asset, out ContentLevel level) { for (var i = 0; i < _loadedAssets.Length; i++) { if (_loadedAssets[i].TryGetValue(assetName, out asset)) { level = (ContentLevel)i; return(true); } } asset = null; level = 0; return(false); }
/// <summary> /// Checks if an asset is loaded. /// </summary> /// <param name="assetName">The name of the asset to look for.</param> /// <param name="asset">When this method returns true, contains the asset instance.</param> /// <param name="level">When this method returns true, contains the asset's <see cref="ContentLevel"/>.</param> /// <returns>True if the asset is loaded; otherwise false.</returns> bool IsAssetLoaded(string assetName, out IMyLazyAsset asset, out ContentLevel level) { for (var i = 0; i < _loadedAssets.Length; i++) { if (_loadedAssets[i].TryGetValue(assetName, out asset)) { level = (ContentLevel)i; return true; } } asset = null; level = 0; return false; }