/// <summary> /// 加载模型资源 /// </summary> /// <param name="path">Data/Model/HeroModel/{0}</param> /// <param name="callBackFun"></param> /// <param name="assetPRIType"></param> /// <returns></returns> public IAssetRequest LoadModel(string path, AssetRequestFinishedEventHandler callBackFun, AssetPRI assetPRIType) { IAssetRequest result; if (string.IsNullOrEmpty(path)) { AssetLogger.Error("string.IsNullOrEmpty(path) == true"); result = null; } else { string name = LocalResourceManager.ChangePathToFilenameWithoutExtension(path); ResourceData resourceData = null; List <ResourceData> dependes = null; CollectDepResourceData collectDepResourceData = this.m_DicModelResourceData.GetCollectDepResourceData(name, out resourceData, out dependes); if (null != collectDepResourceData) { result = this.CreateAssetRequest(resourceData, dependes, callBackFun, assetPRIType); } else { AssetLogger.Error(string.Format("null == collectDepResourceData:{0}", path)); result = null; } } return(result); }
public IAssetRequest CreateAssetRequest(string path, AssetRequestFinishedEventHandler callback, AssetPRI assetPRI, EnumAssetType assetType) { if (string.IsNullOrEmpty(path)) { AssetLogger.Error("string.IsNullOrEmpty(path) == true"); return(null); } string arg = Path.GetDirectoryName(path).ToLower(); string text = LocalResourceManager.ChangePathToFilenameWithoutExtension(path); path = string.Format("data/{0}/{1}.ab", arg, text); ResourceData resourceData = CollectDepResourceDataMap.RefResource(text, path, 0, assetType); return(this.CreateAssetRequest(resourceData, null, callback, assetPRI)); }
public IAssetRequest LoadScene(string path, AssetRequestFinishedEventHandler callBackFun, AssetPRI assetPRIType) { IAssetRequest result; if (string.IsNullOrEmpty(path)) { AssetLogger.Error("string.IsNullOrEmpty(path) == true"); result = null; } else { string directoryName = Path.GetDirectoryName(path); string text = LocalResourceManager.ChangePathToFilenameWithoutExtension(path); path = string.Format("data/{0}/{1}.unity3d", directoryName, text); ResourceData resourceData = CollectDepResourceDataMap.RefResource(text, path, 0, EnumAssetType.eAssetType_Scene); result = this.CreateAssetRequest(resourceData, null, callBackFun, assetPRIType); } return(result); }
public IAssetRequest LoadEffect(string path, AssetRequestFinishedEventHandler callback, AssetPRI assetPRI) { if (string.IsNullOrEmpty(path)) { AssetLogger.Error("string.IsNullOrEmpty(path) == true"); return(null); } string name = LocalResourceManager.ChangePathToFilenameWithoutExtension(path); ResourceData resourceData = null; List <ResourceData> list = null; CollectDepResourceData collectDepResourceData = this.m_DicEffectReourceData.GetCollectDepResourceData(name, out resourceData, out list); if (collectDepResourceData != null) { return(this.CreateAssetRequest(resourceData, list, callback, assetPRI)); } AssetLogger.Error(string.Format("null == collectDepResourceData:{0}", path)); return(null); }
/// <summary> /// 加载UI资源 /// </summary> /// <param name="path"></param> /// <param name="callback"></param> /// <param name="assetPRI"></param> /// <returns></returns> public IAssetRequest LoadUI(string path, AssetRequestFinishedEventHandler callback, AssetPRI assetPRI) { if (string.IsNullOrEmpty(path)) { AssetLogger.Error("string.IsNullOrEmpty(path) == true"); return(null); } string text = LocalResourceManager.ChangePathToFilenameWithoutExtension(path);//路径转成文件名不带后缀 ResourceData resourceData = null; List <ResourceData> dependes = null; CollectDepResourceData collectDepResourceData = this.m_DicUIResourceData.GetCollectDepResourceData(text, out resourceData, out dependes); if (collectDepResourceData != null) { return(this.CreateAssetRequest(resourceData, dependes, callback, assetPRI));//创建请求资源实例 } AssetLogger.Error(string.Format("null == collectDepResourceData:{0}", text)); return(null); }