private void OnProgress(Resource res) { if (res.isSucc) { string data = res.GetText(); ParseData(res.path, data); } }
private void OnLoadAssetMapping(Resource res, string path) { try { if (res.isSucc) { string text = res.GetText(); XmlDocument document = new XmlDocument(); document.LoadXml(text); string manifestFilePath = ""; foreach (XmlElement element in document.FirstChild.NextSibling.ChildNodes) { if (element.Name == "manifest") { manifestFilePath = element.GetAttribute("path"); } if (element.Name == "assetmapping") { string assetPath = element.GetAttribute("assetpath"); string bundlePath = element.GetAttribute("assetbundlepath"); m_dicAssetPathToAssetBundleNames.Add(assetPath, bundlePath); } } ResourceSys.Instance.GetResource(manifestFilePath, OnLoadManifest, OnLoadManifest, ResourceType.AssetBundle); } else { if (m_cCallback != null) { CLog.LogError("AssetBundleFile文件初始化失败!"); var callback = m_cCallback; m_cCallback = null; callback.Invoke(false); } } } catch (Exception e) { CLog.LogError(e.Message + "," + e.StackTrace); } }