From f4a702e212d1853735f8dae399da69d23bfa510e Mon Sep 17 00:00:00 2001
From: yyl <yyl>
Date: 星期四, 26 三月 2026 18:16:16 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master' into h5version
---
Main/System/Invest/InvestModel.cs | 48 +++++++++++++++++++++++++++++++++++++++++-------
1 files changed, 41 insertions(+), 7 deletions(-)
diff --git a/Main/System/Invest/InvestModel.cs b/Main/System/Invest/InvestModel.cs
index a8bb58c..378a301 100644
--- a/Main/System/Invest/InvestModel.cs
+++ b/Main/System/Invest/InvestModel.cs
@@ -4,7 +4,7 @@
using UnityEngine.UI;
using System.Linq;
using LitJson;
-using Cysharp.Threading.Tasks;
+using UnityEngine;
public class InvestModel : GameSystemManager<InvestModel>
{
@@ -16,6 +16,9 @@
Dictionary<int, int[][]> m_InvestItems = new Dictionary<int, int[][]>();
Dictionary<int, int> m_InvestDays = new Dictionary<int, int>(); //鎶曡祫瀵瑰簲澶╂暟
Dictionary<int, int> m_InvestMaxDays = new Dictionary<int, int>(); //鎶曡祫瀵瑰簲鏈�澶ц喘涔扮疮鍔犲ぉ鏁�
+
+ public Dictionary<int, int[]> textColors = new();
+ public Dictionary<int, int[]> outlineColors = new();
//鎶曡祫瀵瑰簲鍏呭�糏D
Dictionary<int, int[]> m_InvestRechargeIds = new Dictionary<int, int[]>();
@@ -43,7 +46,7 @@
Dictionary<int, int> m_PrivilegeFightSpeed = new Dictionary<int, int>();
// 鑻遍泟绉垎鎷涘嫙寮�鍚殑鐗规潈绫诲瀷
int[] heroScoreCallOpenType;
-
+
public event Action<int> onInvestUpdate;
@@ -73,13 +76,25 @@
return FuncOpen.Instance.IsFuncOpen((int)FuncOpenEnum.PrivilegeCard);
}
-
+
public void OnBeforePlayerDataInitialize()
{
m_InvestInfos.Clear();
lastTotalBuyCountDict.Clear();
}
+
+
+ public Color32 ParseColor32(int[] colorArr)
+ {
+ return new Color32()
+ {
+ r = (byte)(colorArr.Length > 0 ? colorArr[0] : 0),
+ g = (byte)(colorArr.Length > 1 ? colorArr[1] : 0),
+ b = (byte)(colorArr.Length > 2 ? colorArr[2] : 0),
+ a = (byte)(colorArr.Length > 3 ? colorArr[3] : 255),
+ };
+ }
void ParseConfig()
@@ -96,7 +111,6 @@
m_InvestMaxDays = ConfigParse.ParseIntDict(funcConfig.Numerical2);
m_InvestItems = ConfigParse.ParseIntArray2Dict(funcConfig.Numerical3);
-
funcConfig = FuncConfigConfig.Get("InvestPower");
m_InvestAddFBCount = ConfigParse.ParseDictInDict(funcConfig.Numerical1);
m_InvestFreeFBID = ConfigParse.ParseIntArrayDict(funcConfig.Numerical2);
@@ -108,7 +122,27 @@
m_PrivilegeLins = ConfigParse.ParseIntDict(funcConfig.Numerical1);
m_PrivilegeFightSpeed = ConfigParse.ParseIntDict(funcConfig.Numerical2);
heroScoreCallOpenType = JsonMapper.ToObject<int[]>(funcConfig.Numerical3);
-
+ textColors = ConfigParse.ParseIntArrayDict(funcConfig.Numerical4);
+ outlineColors = ConfigParse.ParseIntArrayDict(funcConfig.Numerical5);
+
+ }
+
+ public Color32 GetTextColor(int vipLevel)
+ {
+ if (textColors.ContainsKey(vipLevel))
+ {
+ return ParseColor32(textColors[vipLevel]);
+ }
+ return Color.white;
+ }
+
+ public Color32 GetOutlineColor(int vipLevel)
+ {
+ if (outlineColors.ContainsKey(vipLevel))
+ {
+ return ParseColor32(outlineColors[vipLevel]);
+ }
+ return Color.white;
}
Dictionary<int, int> lastTotalBuyCountDict = new Dictionary<int, int>();
@@ -129,7 +163,7 @@
if (count < rechargeCount.totalCount)
{
lastTotalBuyCountDict[type] = rechargeCount.totalCount;
- UIManager.Instance.OpenWindowAsync<PrivilegeActiveCardWin>(type).Forget();
+ UIManager.Instance.OpenWindow<PrivilegeActiveCardWin>(type);
}
}
}
@@ -176,7 +210,7 @@
//鏈堝崱 闄愭椂绫诲瀷鐨勬姇璧� 鏈埌鏈熷氨绠楁姇璧�
return m_InvestInfos[type].InvestEndTime > 0 && m_InvestInfos[type].InvestEndTime > TimeUtility.AllSeconds;
}
-
+
//姘镐箙绫诲瀷鐨勬姇璧� 鍙璐拱浜嗗氨绠楁姇璧�
return m_InvestInfos[type].InvestBuyTime > 0;
}
--
Gitblit v1.8.0