From 2ebcf3631690f5bd4eb93a1bb2d7b354c4c7c5fa Mon Sep 17 00:00:00 2001
From: hch <305670599@qq.com>
Date: 星期五, 13 三月 2026 15:23:56 +0800
Subject: [PATCH] 500 子 【武将】武将时装 / 【武将】武将时装-客户端
---
Main/System/HeroUI/HeroSkinRoleCell.cs.meta | 11 ++
Main/Config/Configs/HeroSkinAttrConfig.cs | 45 ++++----
Main/System/HeroUI/HeroSkinCell.cs | 3
Main/System/HeroUI/HeroSkinChooseWin.cs | 84 ++++++++++++++++
Main/Config/ConfigManager.cs | 2
Main/System/HeroUI/HeroSkinRoleCell.cs | 23 ++++
Main/System/HeroUI/HeroSkinRoleLineCell.cs.meta | 11 ++
Main/System/HeroUI/HeroSkinWin.cs | 15 ++
Main/System/Main/FightPowerManager.cs | 4
Main/System/HeroUI/HeroSkinChooseWin.cs.meta | 11 ++
Main/Config/Configs/HeroSkinConfig.cs | 31 ++---
Main/System/HeroUI/HeroSkinRoleLineCell.cs | 23 ++++
12 files changed, 218 insertions(+), 45 deletions(-)
diff --git a/Main/Config/ConfigManager.cs b/Main/Config/ConfigManager.cs
index f829e1c..bb42054 100644
--- a/Main/Config/ConfigManager.cs
+++ b/Main/Config/ConfigManager.cs
@@ -146,7 +146,7 @@
LoadConfigByType(configType);
sw.Stop();
#if UNITY_EDITOR
- if (sw.ElapsedMilliseconds >= 500)
+ if (sw.ElapsedMilliseconds >= 100)
{
Debug.LogError($"鍔犺浇閰嶇疆 {configType.Name} 鑰楁椂杈冮暱: {sw.ElapsedMilliseconds} ms");
}
diff --git a/Main/Config/Configs/HeroSkinAttrConfig.cs b/Main/Config/Configs/HeroSkinAttrConfig.cs
index 0b057e8..6b65dea 100644
--- a/Main/Config/Configs/HeroSkinAttrConfig.cs
+++ b/Main/Config/Configs/HeroSkinAttrConfig.cs
@@ -1,6 +1,6 @@
锘�//--------------------------------------------------------
// [Author]: YYL
-// [ Date ]: 2026骞�3鏈�4鏃�
+// [ Date ]: 2026骞�3鏈�13鏃�
//--------------------------------------------------------
using System.Collections.Generic;
@@ -17,6 +17,7 @@
}
public int SkinID;
+ public int Quality;
public int NeedItemID;
public int StarMax;
public int[] WearAttrIDList;
@@ -38,17 +39,19 @@
string[] tables = input.Split('\t');
int.TryParse(tables[0],out SkinID);
- int.TryParse(tables[1],out NeedItemID);
+ int.TryParse(tables[1],out Quality);
- int.TryParse(tables[2],out StarMax);
+ int.TryParse(tables[2],out NeedItemID);
- if (tables[3].Contains("["))
+ int.TryParse(tables[3],out StarMax);
+
+ if (tables[4].Contains("["))
{
- WearAttrIDList = JsonMapper.ToObject<int[]>(tables[3]);
+ WearAttrIDList = JsonMapper.ToObject<int[]>(tables[4]);
}
else
{
- string[] WearAttrIDListStringArray = tables[3].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries);
+ string[] WearAttrIDListStringArray = tables[4].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries);
WearAttrIDList = new int[WearAttrIDListStringArray.Length];
for (int i=0;i<WearAttrIDListStringArray.Length;i++)
{
@@ -56,13 +59,13 @@
}
}
- if (tables[4].Contains("["))
+ if (tables[5].Contains("["))
{
- WearAttrValueList = JsonMapper.ToObject<int[]>(tables[4]);
+ WearAttrValueList = JsonMapper.ToObject<int[]>(tables[5]);
}
else
{
- string[] WearAttrValueListStringArray = tables[4].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries);
+ string[] WearAttrValueListStringArray = tables[5].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries);
WearAttrValueList = new int[WearAttrValueListStringArray.Length];
for (int i=0;i<WearAttrValueListStringArray.Length;i++)
{
@@ -70,13 +73,13 @@
}
}
- if (tables[5].Contains("["))
+ if (tables[6].Contains("["))
{
- WearAttrPerStarAddList = JsonMapper.ToObject<int[]>(tables[5]);
+ WearAttrPerStarAddList = JsonMapper.ToObject<int[]>(tables[6]);
}
else
{
- string[] WearAttrPerStarAddListStringArray = tables[5].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries);
+ string[] WearAttrPerStarAddListStringArray = tables[6].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries);
WearAttrPerStarAddList = new int[WearAttrPerStarAddListStringArray.Length];
for (int i=0;i<WearAttrPerStarAddListStringArray.Length;i++)
{
@@ -84,13 +87,13 @@
}
}
- if (tables[6].Contains("["))
+ if (tables[7].Contains("["))
{
- RoleAttrIDList = JsonMapper.ToObject<int[]>(tables[6]);
+ RoleAttrIDList = JsonMapper.ToObject<int[]>(tables[7]);
}
else
{
- string[] RoleAttrIDListStringArray = tables[6].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries);
+ string[] RoleAttrIDListStringArray = tables[7].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries);
RoleAttrIDList = new int[RoleAttrIDListStringArray.Length];
for (int i=0;i<RoleAttrIDListStringArray.Length;i++)
{
@@ -98,13 +101,13 @@
}
}
- if (tables[7].Contains("["))
+ if (tables[8].Contains("["))
{
- RoleAttrValueList = JsonMapper.ToObject<int[]>(tables[7]);
+ RoleAttrValueList = JsonMapper.ToObject<int[]>(tables[8]);
}
else
{
- string[] RoleAttrValueListStringArray = tables[7].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries);
+ string[] RoleAttrValueListStringArray = tables[8].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries);
RoleAttrValueList = new int[RoleAttrValueListStringArray.Length];
for (int i=0;i<RoleAttrValueListStringArray.Length;i++)
{
@@ -112,13 +115,13 @@
}
}
- if (tables[8].Contains("["))
+ if (tables[9].Contains("["))
{
- RoleAttrPerStarAddList = JsonMapper.ToObject<int[]>(tables[8]);
+ RoleAttrPerStarAddList = JsonMapper.ToObject<int[]>(tables[9]);
}
else
{
- string[] RoleAttrPerStarAddListStringArray = tables[8].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries);
+ string[] RoleAttrPerStarAddListStringArray = tables[9].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries);
RoleAttrPerStarAddList = new int[RoleAttrPerStarAddListStringArray.Length];
for (int i=0;i<RoleAttrPerStarAddListStringArray.Length;i++)
{
diff --git a/Main/Config/Configs/HeroSkinConfig.cs b/Main/Config/Configs/HeroSkinConfig.cs
index f8e6908..0deff42 100644
--- a/Main/Config/Configs/HeroSkinConfig.cs
+++ b/Main/Config/Configs/HeroSkinConfig.cs
@@ -1,6 +1,6 @@
锘�//--------------------------------------------------------
// [Author]: YYL
-// [ Date ]: 2026骞�3鏈�11鏃�
+// [ Date ]: 2026骞�3鏈�13鏃�
//--------------------------------------------------------
using System.Collections.Generic;
@@ -19,7 +19,6 @@
public int SkinID;
public string SkinName;
public string BG;
- public int Quality;
public int AudioID;
public string Tachie;
public float[] TachieParam;
@@ -48,19 +47,17 @@
BG = tables[2];
- int.TryParse(tables[3],out Quality);
+ int.TryParse(tables[3],out AudioID);
- int.TryParse(tables[4],out AudioID);
+ Tachie = tables[4];
- Tachie = tables[5];
-
- if (tables[6].Contains("["))
+ if (tables[5].Contains("["))
{
- TachieParam = JsonMapper.ToObject<float[]>(tables[6]);
+ TachieParam = JsonMapper.ToObject<float[]>(tables[5]);
}
else
{
- string[] TachieParamStringArray = tables[6].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries);
+ string[] TachieParamStringArray = tables[5].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries);
TachieParam = new float[TachieParamStringArray.Length];
for (int i=0;i<TachieParamStringArray.Length;i++)
{
@@ -68,21 +65,21 @@
}
}
- SquareIcon = tables[7];
+ SquareIcon = tables[6];
- RectangleIcon = tables[8];
+ RectangleIcon = tables[7];
- CardPic = tables[9];
+ CardPic = tables[8];
- SpineRes = tables[10];
+ SpineRes = tables[9];
- InitialSkinName = tables[11];
+ InitialSkinName = tables[10];
- ApearMotionName = tables[12];
+ ApearMotionName = tables[11];
- TransfMotionName = tables[13];
+ TransfMotionName = tables[12];
- LoopMotionName = tables[14];
+ LoopMotionName = tables[13];
}
catch (Exception exception)
{
diff --git a/Main/System/HeroUI/HeroSkinCell.cs b/Main/System/HeroUI/HeroSkinCell.cs
index c900bc5..c5acc69 100644
--- a/Main/System/HeroUI/HeroSkinCell.cs
+++ b/Main/System/HeroUI/HeroSkinCell.cs
@@ -18,8 +18,9 @@
{
var skinID = HeroConfig.Get(heroID).SkinIDList[index];
var skinConfig = HeroSkinConfig.Get(skinID);
+ var attrCfg = HeroSkinAttrConfig.Get(skinID);
skinImage.SetOrgSprite(skinConfig.CardPic, "HeroSkinCard");
- skinFrame.SetSprite("HeroSkinFrame" + skinConfig.Quality);
+ skinFrame.SetSprite("HeroSkinFrame" + (attrCfg== null ? 0 : attrCfg.Quality));
skinName.text = skinConfig.SkinName == "" ? Language.Get("HeroSkin2") : skinConfig.SkinName;
if (!isHero)
{
diff --git a/Main/System/HeroUI/HeroSkinChooseWin.cs b/Main/System/HeroUI/HeroSkinChooseWin.cs
new file mode 100644
index 0000000..7fe66ca
--- /dev/null
+++ b/Main/System/HeroUI/HeroSkinChooseWin.cs
@@ -0,0 +1,84 @@
+using System;
+using System.Collections.Generic;
+using UnityEngine;
+using UnityEngine.UI;
+
+
+/// <summary>
+/// 姝﹀皢鐨偆褰㈣薄閫夋嫨
+/// </summary>
+public class HeroSkinChooseWin : UIBase
+{
+ [SerializeField] Button closeBtn;
+ [SerializeField] Button okBtn;
+ [SerializeField] ScrollerController skinScroller;
+
+ public static int selectIndex;
+ public static List<int> activeIndexList = new List<int>();
+ HeroConfig heroConfig;
+
+ protected override void InitComponent()
+ {
+ closeBtn.AddListener(() =>
+ {
+ CloseWindow();
+ });
+ okBtn.AddListener(() =>
+ {
+ var hero = HeroManager.Instance.GetHero(HeroUIManager.Instance.selectHeroGuid);
+ HeroUIManager.Instance.SendSkinOP(hero.heroId, heroConfig.SkinIDList[selectIndex], 2, hero.itemHero.gridIndex);
+ CloseWindow();
+ });
+
+ }
+
+ protected override void OnPreOpen()
+ {
+ var hero = HeroManager.Instance.GetHero(HeroUIManager.Instance.selectHeroGuid);
+ heroConfig = hero.heroConfig;
+ skinScroller.OnRefreshCell += OnRefreshCell;
+ selectIndex = hero.SkinIndex;
+ activeIndexList = new List<int>();
+ for (int i = 0; i < heroConfig.SkinIDList.Length; i++)
+ {
+ if (HeroUIManager.Instance.IsHeroSkinActive(hero.heroId, heroConfig.SkinIDList[i]))
+ {
+ activeIndexList.Add(i);
+ }
+ }
+ CreateScroller();
+ }
+
+ protected override void OnPreClose()
+ {
+ skinScroller.OnRefreshCell -= OnRefreshCell;
+ heroConfig = null;
+ }
+
+ void CreateScroller()
+ {
+
+ skinScroller.Refresh();
+ for (int i = 0; i < activeIndexList.Count; i++)
+ {
+ if (i % 4 == 0)
+ {
+ skinScroller.AddCell(ScrollerDataType.Header, i);
+ }
+ }
+ skinScroller.Restart();
+
+ }
+
+ void OnRefreshCell(ScrollerDataType type, CellView cell)
+ {
+ var _cell = cell as HeroSkinRoleLineCell;
+ _cell.Display(heroConfig, cell.index);
+ }
+
+ public void SetSelectIndex(int index)
+ {
+ selectIndex = index;
+ skinScroller.m_Scorller.RefreshActiveCellViews();
+ }
+}
\ No newline at end of file
diff --git a/Main/System/HeroUI/HeroSkinChooseWin.cs.meta b/Main/System/HeroUI/HeroSkinChooseWin.cs.meta
new file mode 100644
index 0000000..b593658
--- /dev/null
+++ b/Main/System/HeroUI/HeroSkinChooseWin.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 186027f98fd6d5e4d95ce7d41ba5f040
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/System/HeroUI/HeroSkinRoleCell.cs b/Main/System/HeroUI/HeroSkinRoleCell.cs
new file mode 100644
index 0000000..a0a6fef
--- /dev/null
+++ b/Main/System/HeroUI/HeroSkinRoleCell.cs
@@ -0,0 +1,23 @@
+锘縰sing System;
+using System.Collections.Generic;
+using UnityEngine;
+using UnityEngine.UI;
+public class HeroSkinRoleCell : MonoBehaviour
+{
+ [SerializeField] UIHeroController heroModel;
+ [SerializeField] Image selectImg;
+ [SerializeField] Button selectBtn;
+
+ //index涓虹毊鑲よ〃涓储寮�
+ public void Display(HeroConfig heroConfig, int index)
+ {
+ selectImg.SetActive(HeroSkinChooseWin.selectIndex == index);
+ heroModel.Create(heroConfig.SkinIDList[index], heroConfig.UIScale);
+ selectBtn.AddListener(() =>
+ {
+ var ui = UIManager.Instance.GetUI<HeroSkinChooseWin>();
+ ui.SetSelectIndex(index);
+
+ });
+ }
+}
diff --git a/Main/System/HeroUI/HeroSkinRoleCell.cs.meta b/Main/System/HeroUI/HeroSkinRoleCell.cs.meta
new file mode 100644
index 0000000..b6476e4
--- /dev/null
+++ b/Main/System/HeroUI/HeroSkinRoleCell.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 340939aa27fc7bb4eafbe1bc3e58dda2
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/System/HeroUI/HeroSkinRoleLineCell.cs b/Main/System/HeroUI/HeroSkinRoleLineCell.cs
new file mode 100644
index 0000000..a263c77
--- /dev/null
+++ b/Main/System/HeroUI/HeroSkinRoleLineCell.cs
@@ -0,0 +1,23 @@
+锘縰sing UnityEngine;
+public class HeroSkinRoleLineCell : CellView
+{
+ [SerializeField] HeroSkinRoleCell[] skinRoleCells;
+
+ //index 涓� 涓存椂鍒楄〃鐨勭储寮�
+ public void Display(HeroConfig heroConfig, int index)
+ {
+ for (int i = 0; i < skinRoleCells.Length; i++)
+ {
+ if (index + i < HeroSkinChooseWin.activeIndexList.Count)
+ {
+ skinRoleCells[i].SetActive(true);
+ skinRoleCells[i].Display(heroConfig, HeroSkinChooseWin.activeIndexList[index + i]);
+ }
+ else
+ {
+ skinRoleCells[i].SetActive(false);
+ }
+
+ }
+ }
+}
diff --git a/Main/System/HeroUI/HeroSkinRoleLineCell.cs.meta b/Main/System/HeroUI/HeroSkinRoleLineCell.cs.meta
new file mode 100644
index 0000000..f210ed1
--- /dev/null
+++ b/Main/System/HeroUI/HeroSkinRoleLineCell.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 37364238198b1504d979cddfa353daee
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/System/HeroUI/HeroSkinWin.cs b/Main/System/HeroUI/HeroSkinWin.cs
index 39f2db0..4699711 100644
--- a/Main/System/HeroUI/HeroSkinWin.cs
+++ b/Main/System/HeroUI/HeroSkinWin.cs
@@ -80,11 +80,16 @@
}
HeroUIManager.Instance.SendSkinOP(heroID, skinID, 4, hero.itemHero.gridIndex);
});
-
+
showGetObj.AddListener(() =>
{
showGetObj.SetActive(false);
showNormalObj.SetActive(true);
+ });
+
+ changeClothBtn.AddListener(() =>
+ {
+ UIManager.Instance.OpenWindow<HeroSkinChooseWin>();
});
}
@@ -128,11 +133,12 @@
protected override void OnPreClose()
{
- hero = null;
skinScroller.OnRefreshCell -= OnRefreshCell;
HeroUIManager.Instance.OnSkinIndexChanged -= OnSkinIndexChanged;
HeroUIManager.Instance.OnHeroCollectEvent -= OnHeroCollectEvent;
PackManager.Instance.RefreshItemEvent -= OnRefreshItemEvent;
+ hero = null;
+ heroConfig = null;
HeroUIManager.Instance.selectSkinIndex = -1;
}
@@ -259,6 +265,11 @@
shopBtn.SetActive(false);
changeClothBtn.SetActive(false);
}
+ else
+ {
+ shopBtn.SetActive(true);
+ changeClothBtn.SetActive(true);
+ }
if (!HeroUIManager.Instance.IsHeroSkinActive(heroID, skinID))
{
diff --git a/Main/System/Main/FightPowerManager.cs b/Main/System/Main/FightPowerManager.cs
index 52588bc..8713b32 100644
--- a/Main/System/Main/FightPowerManager.cs
+++ b/Main/System/Main/FightPowerManager.cs
@@ -366,9 +366,8 @@
//姝﹀皢鐨偆
var skinValue = HeroUIManager.Instance.GetSkinAttrValue(attrType);
- var skinPer = HeroUIManager.Instance.GetSkinAttrPer(attrType);
+ var skinPer = HeroUIManager.Instance.GetSkinAttrPer(attrType) / 10000.0;
var heroSkinValue = hero.GetHeroSkinValue(attrType);
- var heroSkinPer = hero.GetHeroSkinPer(attrType);
double value = (lvValue+equipValue+realmValue+gubaoValue+hjgValue+horseValue+beautyValue+fatesValue+skinValue+dingjungeValue+minggeValue)*(1+lineupHaloPer+realmPer+gubaoPer+hjgPer+horsePer+beautyPer+fatesPer+skinPer+cardPer+minggePer)*(inheritPer+fetterPer+starTalentPer+breakLVPer+awakeTalentPer)*(1+dingjungePer)+heroSelfValue+heroLVValue+heroSkinValue;
@@ -413,7 +412,6 @@
//姝﹀皢鐨偆
var heroSkinValue = hero.GetHeroSkinValue(attrType);
- var heroSkinPer = hero.GetHeroSkinPer(attrType);
double value = (lvValue+equipValue+realmValue+gubaoValue+hjgValue+horseValue+beautyValue+fatesValue+dingjungeValue+minggeValue)+(heroSelfValue+heroSkinValue+lineupHaloValue+starTalentValue+breakLVValue+awakeTalentValue)+fetterValue;
--
Gitblit v1.8.0