// private IEnumerator DoInit() // { // //load asset bundle mainifest // AssetBundle assetBundle = AssetBundle.LoadFromFile(string.Format("{0}/{1}", ResUtility.GetAssetBundlesPath(), ResUtility.ASSET_BUNDLE_FOLDER_NAME)); // AssetBundleManifest manifest = assetBundle.LoadAsset<AssetBundleManifest>(ResUtility.ASSET_BUNDLE_MANIFEST); // } private void LoadAssetFromLocal <T>(AssetId assetId, LoadAssetDelegate <T> onFinished) where T : Object { T asset = null; bool isSuccess = false; string errMsg = string.Empty; try { asset = AssetDatabase.LoadAssetAtPath <T>(assetId.ToString()); } catch (System.Exception e) { isSuccess = false; errMsg = e.ToString(); } finally { onFinished(isSuccess, errMsg, asset); } }
public static string ConvertAssetIdToAssetBundlePath(AssetId assetId) { return($"{GetAssetBundlesPath()}/{assetId.ToString()}"); }
public static string ConvertAssetIdToAssetBundlePath(AssetId assetId) { return(string.Format("{0}/{1}", GetAssetBundlesPath(), assetId.ToString())); }