From 7ceccc591077b348613dcd1880408b82e2a183d4 Mon Sep 17 00:00:00 2001
From: hch <305670599@qq.com>
Date: 星期四, 04 十二月 2025 21:20:41 +0800
Subject: [PATCH] 0312 分包下载初版

---
 Main/System/AssetVersion/InGameDownLoad.cs |   66 ++++++++------------------------
 1 files changed, 17 insertions(+), 49 deletions(-)

diff --git a/Main/System/AssetVersion/InGameDownLoad.cs b/Main/System/AssetVersion/InGameDownLoad.cs
index 3a5965e..2edd531 100644
--- a/Main/System/AssetVersion/InGameDownLoad.cs
+++ b/Main/System/AssetVersion/InGameDownLoad.cs
@@ -3,6 +3,7 @@
 using UnityEngine;
 using System;
 using System.Text.RegularExpressions;
+using LitJson;
 
 
 public class InGameDownLoad : SingletonMonobehaviour<InGameDownLoad>
@@ -79,7 +80,7 @@
         }
     }
 
-    public List<Reward> rewards = new List<Reward>();
+    public int[][] rewards;
     public bool hasReward { get; private set; }//鏄惁鏈夊鍔�
     public string completeDownLoadAccount
     {
@@ -87,7 +88,7 @@
         set { LocalSave.SetString("InGameDownLoadCompleteAccount", value); }
     }
 
-    public Redpoint downLoadRedpoint = new Redpoint(116);
+    public Redpoint downLoadRedpoint = new Redpoint(MainRedDot.RedPoint_Download);
 
     private void Awake()
     {
@@ -151,16 +152,7 @@
         {
             var assetVersion = this.assets[i];
             totalSize += assetVersion.size;//缁熻璧勬簮鎬诲ぇ灏�
-            //缁熻鍦板浘涓撳睘鐨勮祫婧� TODO YYL
-            // var mapId = PriorBundleConfig.GetAssetBelongToMap(assetVersion.GetAssetCategory(), AssetVersionUtility.DecodeFileName(assetVersion.fileName));
-            // if (mapId != 0)
-            // {
-            //     if (!mapTasks.ContainsKey(mapId))
-            //     {
-            //         mapTasks[mapId] = new List<AssetVersion>();
-            //     }
-            //     mapTasks[mapId].Add(assetVersion);
-            // }
+
             //娣诲姞涓嬭浇浠诲姟
             var remoteURL = StringUtility.Contact(VersionUtility.Instance.versionInfo.GetResourcesURL(VersionConfig.Get().branch), Language.fixPath, "/", assetVersion.relativePath);
             var localURL = StringUtility.Contact(ResourcesPath.Instance.ExternalStorePath, assetVersion.relativePath);
@@ -179,15 +171,14 @@
         var categoryA = lhs.GetAssetCategory();
         var categoryB = rhs.GetAssetCategory();
 
-        // TODO YYL
-        // var priorA = PriorBundleConfig.GetAssetPrior(categoryA, AssetVersionUtility.DecodeFileName(lhs.fileName));
-        // var priorB = PriorBundleConfig.GetAssetPrior(categoryB, AssetVersionUtility.DecodeFileName(rhs.fileName));
+        var priorA = PriorBundleConfig.GetAssetPrior(categoryA, AssetVersionUtility.DecodeFileName(lhs.fileName));
+        var priorB = PriorBundleConfig.GetAssetPrior(categoryB, AssetVersionUtility.DecodeFileName(rhs.fileName));
 
-        // if (priorA != priorB)
-        // {
-        //     return priorA < priorB ? -1 : 1;
-        // }
-        // else
+        if (priorA != priorB)
+        {
+            return priorA < priorB ? -1 : 1;
+        }
+        else
         {
             var isManifestA = lhs.extersion == ".manifest";
             var isManifestB = rhs.extersion == ".manifest";
@@ -265,7 +256,7 @@
                     state = State.Prepared;
                 }
                 dominantState = Dominant.Whole;
-                // UIManager.Instance.OpenWindow<InGameDownLoadWin>();
+                UIManager.Instance.OpenWindow<InGameDownLoadWin>();
                 break;
         }
     }
@@ -314,7 +305,7 @@
         {
             if (dominantState == Dominant.None)
             {
-                RequestDownLoadReward(false);
+                // RequestDownLoadReward(false);
                 state = State.Completed;
             }
             else
@@ -340,11 +331,9 @@
 
     public void ParseRewardConfig()
     {
-        var rewardString = FuncConfigConfig.Get("DownReward").Numerical1;
-        var matches = Regex.Matches(rewardString, "(\\d+,\\d+,\\d+)");
-        for (int i = 0; i < matches.Count; i++)
+        if (rewards.IsNullOrEmpty())
         {
-            rewards.Add(new Reward(matches[i].Value));
+            rewards = JsonMapper.ToObject<int[][]>(FuncConfigConfig.Get("DownReward").Numerical1);
         }
     }
 
@@ -360,11 +349,11 @@
         downLoadRedpoint.state = state == State.Award ? RedPointState.Simple : RedPointState.None;
     }
 
-    public void RequestDownLoadReward(bool _manual)
+    public void RequestDownLoadReward()
     {
         var send = new CA504_tagCMPlayerGetReward();
         send.RewardType = 15;
-        send.DataEx = (byte)(_manual ? 0 : 1);
+        // send.DataEx = (byte)(_manual ? 0 : 1);
         GameNetSystem.Instance.SendInfo(send);
     }
 
@@ -667,26 +656,5 @@
         Whole = 2,
     }
 
-    #region 鐧诲綍涓嬭浇鐣岄潰 DownLoadWin
-    // 澧炲姞涓嬭浇濂栧姳 鏍规嵁鏍囪瘑鍐冲畾澶氭鍙戞斁;娉ㄦ剰涓嶈涓庢父鎴忓唴鐨勫畬鏁翠笅杞芥贩娣�
-    // 鍚庣画鏀规垚appversion_new澧炲姞鎵╁睍淇℃伅杩斿洖涓嬭浇鏍囪瘑锛岀敤浜庢帶鍒跺綋鍓嶆槸鍚︽樉绀哄鍔�,姝ゅ棣栧寘杩樻湭鍖呭惈鍥剧墖璧勬簮
 
-    public int downloadMark = 0;
-
-    public bool IsShowDownloadAward()
-    {
-        int downloadMark = 0;
-        int.TryParse(VersionUtility.Instance.versionInfo.ResourceAward, out downloadMark);
-        var mark = LocalSave.GetInt("downloadMark");
-        return downloadMark > mark;
-
-    }
-
-    //涓嬭浇瀹屾瘯鎴愬姛鐧诲綍娓告垙鍗冲彲璁剧疆
-    public void SetDownloadMark()
-    {
-        LocalSave.SetInt("downloadMark", int.Parse(FuncConfigConfig.Get("DownReward").Numerical4));
-    }
-
-    #endregion
 }
\ No newline at end of file

--
Gitblit v1.8.0