public AssetBundleIndexItem GetAssetBundleIndexItem(string assetBundleName, int?assetNameHash, string type = "") { AssetBundleIndexItem indexAsset = null; foreach (AssetBundleIndexList iAssetList in bundlesIndex) { if (indexAsset != null) { break; } if (iAssetList.assetBundleName == assetBundleName) { foreach (AssetBundleIndexItem iAsset in iAssetList.assetBundleAssets) { if (assetNameHash == iAsset.assetHash) { if (type == "" || (type != "" && (type == iAsset.assetType || type == GetTypeWithoutAssembly(iAsset.assetType)))) { indexAsset = iAsset; } } if (indexAsset != null) { break; } } } } return(indexAsset); }
/// <summary> /// Adds an AssetBundleIndexItem to the list of assetBundleAssets with the given filename. /// </summary> /// <param name="filename"></param> /// <param name="obj"></param> public void AddItem(string filename, UnityEngine.Object obj) { AssetBundleIndexItem thisItem = new AssetBundleIndexItem(); thisItem.AddData(filename, obj); assetBundleAssets.Add(thisItem); }
public AssetBundleIndexItem GetAssetBundleIndexItem(string assetBundleName, int?assetNameHash, string type = "") { AssetBundleIndexItem indexAsset = null; //foreach (AssetBundleIndexList iAssetList in bundlesIndex) for (int i = 0; i < bundlesIndex.Count; i++) { if (indexAsset != null) { break; } if (bundlesIndex[i].assetBundleName == assetBundleName) { //foreach (AssetBundleIndexItem iAsset in iAssetList.assetBundleAssets) for (int ii = 0; ii < bundlesIndex[i].assetBundleAssets.Count; ii++) { if (assetNameHash == bundlesIndex[i].assetBundleAssets[ii].assetHash) { if (type == "" || (type != "" && (type == bundlesIndex[i].assetBundleAssets[ii].assetType || type == GetTypeWithoutAssembly(bundlesIndex[i].assetBundleAssets[ii].assetType)))) { indexAsset = bundlesIndex[i].assetBundleAssets[ii]; } } if (indexAsset != null) { break; } } } } return(indexAsset); }
public List <string> AssetWardrobeCollectionCompatibleWith(string assetBundleName, string assetName) { AssetBundleIndexItem thisIndexAsset = GetAssetBundleIndexItem(assetBundleName, assetName, "UMAWardrobeCollection"); return(thisIndexAsset.assetWardrobeCompatibleWith); }
//Wardrobe Collection specific data search functions... public string AssetWardrobeCollectionSlot(string assetBundleName, string assetName) { AssetBundleIndexItem thisIndexAsset = GetAssetBundleIndexItem(assetBundleName, assetName, "UMAWardrobeCollection"); return(thisIndexAsset.assetWardrobeSlot); }