From 5301d08eac2f7f0b25ce3f2bef7d24f92c79321c Mon Sep 17 00:00:00 2001
From: lcy <1459594991@qq.com>
Date: 星期四, 19 三月 2026 15:20:20 +0800
Subject: [PATCH] 533 开服冲榜-客户端 特权卡标识更换正式资源
---
Main/System/Invest/InvestModel.cs | 45 ++++++++++++++++++++++++++++++++++++++++-----
1 files changed, 40 insertions(+), 5 deletions(-)
diff --git a/Main/System/Invest/InvestModel.cs b/Main/System/Invest/InvestModel.cs
index 0dfa8b1..378a301 100644
--- a/Main/System/Invest/InvestModel.cs
+++ b/Main/System/Invest/InvestModel.cs
@@ -4,6 +4,7 @@
using UnityEngine.UI;
using System.Linq;
using LitJson;
+using UnityEngine;
public class InvestModel : GameSystemManager<InvestModel>
{
@@ -15,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[]>();
@@ -42,7 +46,7 @@
Dictionary<int, int> m_PrivilegeFightSpeed = new Dictionary<int, int>();
// 鑻遍泟绉垎鎷涘嫙寮�鍚殑鐗规潈绫诲瀷
int[] heroScoreCallOpenType;
-
+
public event Action<int> onInvestUpdate;
@@ -72,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()
@@ -95,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);
@@ -107,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>();
@@ -175,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