コード例 #1
0
 private void OnProgress(Resource res)
 {
     if (res.isSucc)
     {
         string data = res.GetText();
         ParseData(res.path, data);
     }
 }
コード例 #2
0
 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);
     }
 }