/// <summary> /// 获取本地资源文件路径 /// </summary> /// <param name="assetBundlName"></param> /// <returns></returns> public static string GetABFilePath(string fileName) { string filePath = GetSandboxABFilePath(fileName); if (MLFileUtil.CheckFileExits(filePath)) { //Debug.Log("Find sandbox ABFile path====" + filePath); return(filePath); } // 获取stream assets 路径的资源不判定文件是否存在 // android不支持文件判定 filePath = GetLocalABFilePath(fileName); #if !UNITY_ANDROID if (MLFileUtil.CheckFileExits(filePath)) { //Debug.Log("Find local ABFile path====" + filePath); return(filePath); } #else //Debugger.Log("Find local ABFile path====" + filePath); return(filePath); #endif return(filePath); }
/// <summary> /// 读取本地资源配置数据 /// </summary> public void LoadLocalGameRes() { // 首先读取沙盒目录下资源配置文件 string xmlPath = ABConfiger.GetSandboxFilePath(TableGameRes.FILE_NAME); Debug.Log("Sandbox xml file path====" + xmlPath); if (MLFileUtil.CheckFileExits(xmlPath)) { localTableResConfig = XMLSerializer.Read <TableGameRes>(xmlPath) as TableGameRes; LoadResConfigComplete(); return; } CoroutineManger.Instance.StartCoroutine(LoadLocalGameResAsync()); }