Prechádzať zdrojové kódy

Merge branch 'hy_en' of ssh://192.168.0.8:29418/XianJing into hy_ios_en

ybx_Gdn 11 mesiacov pred
rodič
commit
fe0f5747c9

+ 6 - 6
Assets/Content/Config/DownLoadUrlCfg.csv

@@ -1,6 +1,6 @@
-ID,Platform,BaseUrl,ServerUrl,Param1,DownloadPath
-ID,Platform,BaseUrl,ServerUrl,Param1,DownloadPath
-int,string,string,string,string,string
-1,GameDebug,http://110.40.223.119:88/,http://110.40.223.119:81/,en,res/TestServerRes/
-2,Android,http://165.154.202.27:88/,http://165.154.202.27:81/,en,res/AndroidNewRes/
-3,IOS,http://165.154.202.27:88/,http://165.154.202.27:81/,en,res/IosRes/
+ID,Platform,BaseUrl,ServerUrl,Param1,DownloadPath,MaxNum
+ID,Platform,BaseUrl,ServerUrl,Param1,DownloadPath,MaxNum
+int,string,string,string,string,string,int
+1,GameDebug,http://110.40.223.119:88/,http://110.40.223.119:81/,en,res/TestServerRes/,1
+2,Android,http://165.154.202.27:88/,http://165.154.202.27:81/,en,res/AndroidNewRes/,1
+3,IOS,http://165.154.202.27:88/,http://165.154.202.27:81/,en,res/IosRes/,1

+ 3 - 2
Assets/Src/Core/DownLoad/AssetDownloader.cs

@@ -22,6 +22,7 @@ public class AssetDownloader : SingletonMono<AssetDownloader>
 
     private void Awake()
     {
+        Debug.Log("AssetDownloader  111");
         Init();
     }
 
@@ -83,7 +84,7 @@ public class AssetDownloader : SingletonMono<AssetDownloader>
         Debug.Log($"url = {url}");
         UnityWebRequest webRqst = UnityWebRequest.Get(url);
         float timeOut = Time.time;
-        webRqst.timeout = 5;
+        webRqst.timeout = 20;
         UnityWebRequestAsyncOperation asyncOperation = webRqst.SendWebRequest();
         float progress = 0;
        
@@ -106,7 +107,7 @@ public class AssetDownloader : SingletonMono<AssetDownloader>
         progress = webRqst.downloadProgress;
         //yield return asyncOperation;
 
-        if (webRqst != null && webRqst.error == null)
+        if (webRqst != null && webRqst.result ==  UnityWebRequest.Result.Success)
         {
             Debug.Log($"[{url}] 下载完成");
             callback?.Invoke(webRqst);

+ 1 - 0
Assets/Src/Core/DownLoad/DownloadDataEntity.cs

@@ -118,6 +118,7 @@ public class DownLoadUrlCfg : GameData<DownLoadUrlCfg>
 
     public string DownloadPath;
 
+    public int MaxNum;
     public bool IsOPen;
 
     public override string FlieName()

+ 6 - 4
Assets/Src/Core/DownLoad/DownloadMgr.cs

@@ -459,10 +459,6 @@ public class DownloadMgr : Singleton<DownloadMgr>
     {
         if (data == null) return null;
         CsvReader csvReader = new CsvReader("urlcfg", data,1,2,3);
-        if (downloadFormatInfo == null)
-        {
-            downloadFormatInfo = new GameDataFormatInfo(csvReader.Fields(), csvReader.Types());
-        }
         DownLoadUrlCfg.OnCsvLoad(csvReader);
         List<DownLoadUrlCfg> resList = DownLoadUrlCfg.AllData();
         DownLoadUrlCfg.Clear();
@@ -925,6 +921,12 @@ public class DownloadMgr : Singleton<DownloadMgr>
         }
 
         curUrlCfg = GetCurUrlCfg();
+        if (curUrlCfg != null)
+        {
+            downloadTaskMaxNum = curUrlCfg.MaxNum;
+            downloadUrl = GetDownloadUrl();
+            Log("downloadUrl = " + downloadUrl);
+        }
 
     }
 

+ 2 - 2
Assets/Src/Core/DownLoad/DownloadTask.cs

@@ -73,7 +73,7 @@ public class DownloadTask : MonoBehaviour
         {
             ret = false;
         }
-        webRqst.timeout = 5;
+        webRqst.timeout = 20;
         return ret;
     }
 
@@ -124,7 +124,7 @@ public class DownloadTask : MonoBehaviour
         CurDownloadEntity.UpDateCallback?.Invoke(this);
      
 
-        if (webRqst != null && webRqst.error == null)
+        if (webRqst != null && webRqst.result ==  UnityWebRequest.Result.Success)
         {
             Debug.Log($"[{CurDownloadEntity.FullName}] 下载完成");
             State = DownloadTaskState.DownloadSuccess;      

+ 5 - 5
Assets/Src/GameLogic/LaunchLoadMgr.cs

@@ -43,11 +43,11 @@ public class LaunchLoadMgr
         //AssetsMgr.Instance.InitDependenciesAsync(OnDependenciesInited);
         //GameObject go = ResourceMgr.Instance.LoadAssetSync<GameObject>(Constants.UIPath, "UILanuch/UILanuch");
         //OnLoadUILanuchCallback(go, null, null);
-        AssetsMgr.Instance.InitAbNameCfg(()=> 
-        {
-            AssetsMgr.Instance.InitDependenciesAsync(OnDependenciesInited);
-        });
-      
+        //AssetsMgr.Instance.InitAbNameCfg(()=> 
+        //{
+        //    AssetsMgr.Instance.InitDependenciesAsync(OnDependenciesInited);
+        //});
+        AssetsMgr.Instance.InitDependenciesAsync(OnDependenciesInited);
     }
 
     public void StopLaunch()