hch
5 天以前 1597500ffb8817259fa1c508fc2aeff79bb80770
117 【武将】武将系统 - 图集
6 文件已复制
23个文件已修改
9个文件已添加
2个文件已删除
2 文件已重命名
1411 ■■■■■ 已修改文件
Main/Config/Configs/HeroConfig.cs 44 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/Config/Configs/HeroTalentConfig.cs 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/Core/NetworkPackage/ClientPack/CB2_NewFunction/CB230_tagCSHeroLVUP.cs 补丁 | 查看 | 原始文档 | blame | 历史
Main/Core/NetworkPackage/ClientPack/CB4_FightDefine/CB412_tagCSHeroLineupSave.cs 补丁 | 查看 | 原始文档 | blame | 历史
Main/Core/NetworkPackage/DTCFile/ServerPack/HB1_Role/DTCB122_tagSCHeroInfo.cs 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/Core/NetworkPackage/DTCFile/ServerPack/HB1_Role/DTCB122_tagSCHeroInfo.cs.meta 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/Core/NetworkPackage/ServerPack/HB1_Role/CB122_tagSCHeroInfo.cs 34 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/Core/NetworkPackage/ServerPack/HB1_Role/HB122_tagSCHeroInfo.cs 35 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/Core/NetworkPackage/ServerPack/HB1_Role/HB122_tagSCHeroInfo.cs.meta 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/ResModule/ResManager.cs 9 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/System/Battle/BattleWin.cs 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/System/Hero/HeroInfo.Awake.cs 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/System/Hero/HeroInfo.Break.cs 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/System/Hero/HeroInfo.Collection.cs 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/System/Hero/HeroInfo.Fetter.cs 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/System/Hero/HeroInfo.Level.cs 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/System/Hero/HeroInfo.Properties.cs 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/System/Hero/HeroInfo.Quality.cs 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/System/Hero/HeroInfo.Skin.cs 13 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/System/Hero/HeroInfo.Star.cs 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/System/Hero/HeroInfo.cs 127 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/System/Hero/HeroManager.cs 142 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/System/Hero/UIHeroController.cs 55 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/System/HeroUI.meta 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/System/HeroUI/GiftBaseCell.cs 195 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/System/HeroUI/GiftBaseCell.cs.meta 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/System/HeroUI/HeroBaseWin.cs 75 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/System/HeroUI/HeroBaseWin.cs.meta 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/System/HeroUI/HeroCardCell.cs 37 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/System/HeroUI/HeroCardCell.cs.meta 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/System/HeroUI/HeroCardLineCell.cs 24 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/System/HeroUI/HeroCardLineCell.cs.meta 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/System/HeroUI/HeroListWin.cs 74 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/System/HeroUI/HeroListWin.cs.meta 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/System/KnapSack/PackManager.cs 25 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/System/Main/FuncsBaseWin.cs 117 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/System/Main/FuncsBaseWin.cs.meta 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/System/Main/HomeWin.cs 55 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/System/Main/MainWin.cs 156 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/System/Tip/PowerAddWin.cs 52 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/Utility/EnumHelper.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/Utility/UIHelper.cs 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/Config/Configs/HeroConfig.cs
@@ -1,6 +1,6 @@
//--------------------------------------------------------
//    [Author]:           YYL
//    [  Date ]:           2025年7月7日
//    [  Date ]:           Tuesday, July 15, 2025
//--------------------------------------------------------
using System.Collections.Generic;
@@ -16,6 +16,7 @@
    public int HeroID;
    public int Country;
    public int Quality;
    public int Class;
    public int[] SkinIDList;
    public int AtkSkillID;
    public int AngerSkillID;
@@ -24,11 +25,6 @@
    public int HPInheritPer;
    public string BatAttrDict;
    public int[] FetterIDList;
    public string Tachie;
    public string SquareIcon;
    public string RectangleIcon;
    public string SpineRes;
    public string BigSizeSpine;
    public override int LoadKey(string _key)
    {
@@ -46,13 +42,15 @@
            int.TryParse(tables[2],out Quality); 
            if (tables[3].Contains("["))
            int.TryParse(tables[3],out Class);
            if (tables[4].Contains("["))
            {
                SkinIDList = JsonMapper.ToObject<int[]>(tables[3]);
                SkinIDList = JsonMapper.ToObject<int[]>(tables[4]);
            }
            else
            {
                string[] SkinIDListStringArray = tables[3].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries);
                string[] SkinIDListStringArray = tables[4].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries);
                SkinIDList = new int[SkinIDListStringArray.Length];
                for (int i=0;i<SkinIDListStringArray.Length;i++)
                {
@@ -60,41 +58,31 @@
                }
            }
            int.TryParse(tables[4],out AtkSkillID);
            int.TryParse(tables[5],out AtkSkillID);
            int.TryParse(tables[5],out AngerSkillID);
            int.TryParse(tables[6],out AngerSkillID);
            int.TryParse(tables[6],out AtkInheritPer);
            int.TryParse(tables[7],out AtkInheritPer);
            int.TryParse(tables[7],out DefInheritPer);
            int.TryParse(tables[8],out DefInheritPer);
            int.TryParse(tables[8],out HPInheritPer);
            int.TryParse(tables[9],out HPInheritPer);
            BatAttrDict = tables[9];
            BatAttrDict = tables[10];
            if (tables[10].Contains("["))
            if (tables[11].Contains("["))
            {
                FetterIDList = JsonMapper.ToObject<int[]>(tables[10]);
                FetterIDList = JsonMapper.ToObject<int[]>(tables[11]);
            }
            else
            {
                string[] FetterIDListStringArray = tables[10].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries);
                string[] FetterIDListStringArray = tables[11].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries);
                FetterIDList = new int[FetterIDListStringArray.Length];
                for (int i=0;i<FetterIDListStringArray.Length;i++)
                {
                     int.TryParse(FetterIDListStringArray[i],out FetterIDList[i]);
                }
            }
            Tachie = tables[11];
            SquareIcon = tables[12];
            RectangleIcon = tables[13];
            SpineRes = tables[14];
            BigSizeSpine = tables[15];
        }
        catch (Exception exception)
        {
Main/Config/Configs/HeroTalentConfig.cs
@@ -1,6 +1,6 @@
//--------------------------------------------------------
//    [Author]:           YYL
//    [  Date ]:           Friday, June 27, 2025
//    [  Date ]:           2025年7月11日
//--------------------------------------------------------
using System.Collections.Generic;
@@ -14,6 +14,7 @@
{
    public int TalentID;
    public string Name;
    public int Quality;
    public int AttrID;
    public int AttrValue;
@@ -30,11 +31,13 @@
        string[] tables = input.Split('\t');
        int.TryParse(tables[0],out TalentID); 
            int.TryParse(tables[1],out Quality);
            Name = tables[1];
            int.TryParse(tables[2],out AttrID);
            int.TryParse(tables[2],out Quality);
            int.TryParse(tables[3],out AttrValue);
            int.TryParse(tables[3],out AttrID);
            int.TryParse(tables[4],out AttrValue);
        }
        catch (Exception exception)
        {
Main/Core/NetworkPackage/ClientPack/CB2_NewFunction/CB230_tagCSHeroLVUP.cs
Main/Core/NetworkPackage/ClientPack/CB4_FightDefine/CB412_tagCSHeroLineupSave.cs
Main/Core/NetworkPackage/DTCFile/ServerPack/HB1_Role/DTCB122_tagSCHeroInfo.cs
New file
@@ -0,0 +1,11 @@
using UnityEngine;
using System.Collections;
// B1 22 武将图鉴信息 #tagSCHeroInfo
public class DTCB122_tagSCHeroInfo : DtcBasic {
    public override void Done(GameNetPackBasic vNetPack) {
        base.Done(vNetPack);
        HB122_tagSCHeroInfo vNetData = vNetPack as HB122_tagSCHeroInfo;
    }
}
Main/Core/NetworkPackage/DTCFile/ServerPack/HB1_Role/DTCB122_tagSCHeroInfo.cs.meta
copy from Main/System/Hero/HeroInfo.Collection.cs.meta copy to Main/Core/NetworkPackage/DTCFile/ServerPack/HB1_Role/DTCB122_tagSCHeroInfo.cs.meta
File was copied from Main/System/Hero/HeroInfo.Collection.cs.meta
@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 14fc4e08ba34d504a936ff5d6c2b7c53
guid: 66418acd27c801d4598bf44cc0027cef
MonoImporter:
  externalObjects: {}
  serializedVersion: 2
Main/Core/NetworkPackage/ServerPack/HB1_Role/CB122_tagSCHeroInfo.cs
File was deleted
Main/Core/NetworkPackage/ServerPack/HB1_Role/HB122_tagSCHeroInfo.cs
New file
@@ -0,0 +1,35 @@
using UnityEngine;
using System.Collections;
// B1 22 武将图鉴信息 #tagSCHeroInfo
public class HB122_tagSCHeroInfo : GameNetPackBasic {
    public ushort HeroCnt;
    public  tagSCHero[] HeroInfoList;
    public HB122_tagSCHeroInfo () {
        _cmd = (ushort)0xB122;
    }
    public override void ReadFromBytes (byte[] vBytes) {
        TransBytes (out HeroCnt, vBytes, NetDataType.WORD);
        HeroInfoList = new tagSCHero[HeroCnt];
        for (int i = 0; i < HeroCnt; i ++) {
            HeroInfoList[i] = new tagSCHero();
            TransBytes (out HeroInfoList[i].HeroID, vBytes, NetDataType.DWORD);
            TransBytes (out HeroInfoList[i].SkinState, vBytes, NetDataType.DWORD);
            TransBytes (out HeroInfoList[i].BookInitState, vBytes, NetDataType.BYTE);
            TransBytes (out HeroInfoList[i].BookStarLV, vBytes, NetDataType.WORD);
            TransBytes (out HeroInfoList[i].BookBreakLV, vBytes, NetDataType.WORD);
        }
    }
    public struct tagSCHero {
        public uint HeroID;        // 武将ID
        public uint SkinState;        // 武将皮肤已解锁状态信息,按皮肤所在索引二进制位运算判断是否解锁,0索引位默认皮肤,不用验证
        public byte BookInitState;        // 图鉴激活状态:0-未激活;1-可激活;2-已激活
        public ushort BookStarLV;        // 图鉴星级等级
        public ushort BookBreakLV;        // 图鉴突破等级
    }
}
Main/Core/NetworkPackage/ServerPack/HB1_Role/HB122_tagSCHeroInfo.cs.meta
File was renamed from Main/Core/NetworkPackage/ServerPack/HB1_Role/CB122_tagSCHeroInfo.cs.meta
@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 202d7c3220a898241b3bc011d6a629f9
guid: e1696a1b8ec22d84e8a41293db691354
MonoImporter:
  externalObjects: {}
  serializedVersion: 2
Main/ResModule/ResManager.cs
@@ -1,14 +1,10 @@
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
using Cysharp.Threading.Tasks;
using System;
using UnityEngine.U2D;
using LitJson;
using System.IO;
using UnityEngine.Networking;
using UnityEngine.Video;
using System.Reflection;
using Spine.Unity;
@@ -77,6 +73,7 @@
        {typeof(Material), "mat"},
        {typeof(VideoClip), "mp4"},
        {typeof(SpriteAtlas), "spriteatlasv2"},
        {typeof(SkeletonDataAsset), "asset"},
    };
@@ -145,8 +142,6 @@
        if (!AssetSource.isUseAssetBundle)
        {
#if UNITY_EDITOR
            //  TODO YYL 还是要找到字符串问题
            path = System.Text.RegularExpressions.Regex.Replace(path, @"[\p{C}]", "");
            asset = UnityEditor.AssetDatabase.LoadAssetAtPath<T>(path);
#endif
        }
Main/System/Battle/BattleWin.cs
@@ -1,9 +1,5 @@
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
using UnityEngine.UI;
using DG.Tweening;
using Cysharp.Threading.Tasks;
public class BattleWin : UIBase
{
Main/System/Hero/HeroInfo.Awake.cs
@@ -4,6 +4,24 @@
public partial class HeroInfo
{
    //  觉醒配置
    public HeroAwakeConfig awakeConfig;
    //  品质觉醒配置
    public HeroQualityAwakeConfig qualityAwakeConfig;
    //  武将觉醒等级
    public int awakeLevel
    {
        get
        {
            if (itemHero == null)
                return 0;
            return itemHero.GetUseDataFirstValue(76);
        }
    }
    protected int GetIFByInheritAwakePercent(HeroAttrType attrType)
    {
        //    YYL TODO
Main/System/Hero/HeroInfo.Break.cs
@@ -3,6 +3,23 @@
public partial class HeroInfo
{
    //  突破配置
    public HeroBreakConfig breakConfig;
    //  品质突破配置
    public HeroQualityBreakConfig qualityBreakConfig;
    //  武将突破等级
    public int breakLevel
    {
        get
        {
            if (itemHero == null)
                return 0;
            return itemHero.GetUseDataFirstValue(74);
        }
    }
    protected int GetBreakCultivationPercent(HeroAttrType attrType)
    {
        //    YYL TODO
Main/System/Hero/HeroInfo.Collection.cs
File was deleted
Main/System/Hero/HeroInfo.Fetter.cs
@@ -3,6 +3,9 @@
public partial class HeroInfo
{
    //  羁绊配置
    public HeroFetterConfig fetterConfig;
    protected int GetIFByInheritFetterPercent(HeroAttrType attrType)
    {
        //    YYL TODO
Main/System/Hero/HeroInfo.Level.cs
@@ -3,6 +3,17 @@
public partial class HeroInfo
{
    //  武将等级
    public int heroLevel
    {
        get
        {
            if (itemHero == null)
                return 0;
            return itemHero.GetUseDataFirstValue(70);
        }
    }
    protected int GetLevelCultivationPercent(HeroAttrType attrType)
    {
        //    YYL TODO
Main/System/Hero/HeroInfo.Properties.cs
@@ -135,7 +135,6 @@
        cultivationPercent += GetLevelCultivationPercent(attrType);// 等级给的百分比 HeroInfo.Level.cs
        cultivationPercent += GetBreakCultivationPercent(attrType);// 突破给的百分比 HeroInfo.Break.cs
        cultivationPercent += GetStarCultivationPercent(attrType);// 吞噬星级给的百分比 HeroInfo.Star.cs
        cultivationPercent += GetCollectionCultivationPercent(attrType);// 图鉴给的百分比 HeroInfo.Collection.cs
        return cultivationPercent;
    }
Main/System/Hero/HeroInfo.Quality.cs
@@ -3,6 +3,17 @@
public partial class HeroInfo
{
    //  品质配置
    public HeroQualityConfig qualityConfig;
    public int Quality
    {
        get
        {
            return heroConfig.Quality;
        }
    }
    protected int GetQualityCultivationPercent(HeroAttrType attrType)
    {
        //    YYL TODO
Main/System/Hero/HeroInfo.Skin.cs
@@ -3,9 +3,16 @@
public partial class HeroInfo
{
    //  服务器数据 皮肤索引
    public int SkinIndex = 0;
    // 78 # 英雄使用的皮肤索引
    public int SkinIndex
    {
        get
        {
            if (itemHero == null)
                return 0;
            return itemHero.GetUseDataFirstValue(78);
        }
    }
    //  服务器数据 皮肤ID
    public int SkinID;
Main/System/Hero/HeroInfo.Star.cs
@@ -3,6 +3,18 @@
public partial class HeroInfo
{
    //  武将星级
    public int heroStar
    {
        get
        {
            if (itemHero == null)
                return 0;
            return itemHero.GetUseDataFirstValue(72);
        }
    }
    protected int GetStarCultivationPercent(HeroAttrType attrType)
    {
        //    YYL TODO
Main/System/Hero/HeroInfo.cs
@@ -1,28 +1,16 @@
using System.Collections.Generic;
using UnityEngine;
using LitJson;
using log4net.Core;
//  武将信息:实际获得的武将,不包含图鉴数据
public partial class HeroInfo
{
    //  武将服务器唯一ID
    public long sid;
    //  武将配置表ID
    public int heroId;
    //  武将等级
    public int heroLevel;
    //  武将星级
    public int heroStar;
    //  武将突破等级
    public int breakLevel;
    //  武将觉醒等级
    public int awakeLevel;
    //  武将配置
    public HeroConfig heroConfig;
    public ItemModel itemHero;  //引用背包里的 数据同步
    public HeroCountry heroCountry
    {
@@ -32,41 +20,36 @@
        }
    }
    public int Quality
    //是否主线上阵 81 # 所在阵容信息列表 [阵容类型*10000+阵型类型*100+位置编号, ...]
    public bool isInMainBattle
    {
        get
        {
            return heroConfig.Quality;
            //从列表中找到 阵容为1的 主线阵容
            var list = itemHero.GetUseData(81);
            if (list != null && list.Count > 0)
            {
                var index = list.FindIndex((item) => item / 10000 == 1);
                if (index >= 0)
                {
                    return true;
        }
    }
    // public readonly CB122_tagSCHeroInfo.tagSCHero scHeroInfo;
            return false;
        }
    }
    //  武将配置
    public HeroConfig heroConfig;
    //  觉醒配置
    public HeroAwakeConfig awakeConfig;
    //  突破配置
    public HeroBreakConfig breakConfig;
    //  羁绊配置
    public HeroFetterConfig fetterConfig;
    //  品质觉醒配置
    public HeroQualityAwakeConfig qualityAwakeConfig;
    //  品质配置
    public HeroQualityConfig qualityConfig;
    //  品质突破配置
    public HeroQualityBreakConfig qualityBreakConfig;
    public List<HeroFetterInfo> fetterInfoList = new List<HeroFetterInfo>();
    public List<HeroTalentInfo> talentList = new List<HeroTalentInfo>();
    public HeroInfo(/*CB122_tagSCHeroInfo.tagSCHero _scHeroInfo, */ItemModel _itemHero)
    public HeroInfo(ItemModel _itemHero)
    {
        // scHeroInfo = _scHeroInfo;
        UpdateHero(_itemHero);
    }
    public HeroInfo(HB424_tagSCTurnFightInit.tagSCTurnFightObj fightObj)
@@ -77,18 +60,13 @@
        heroConfig = HeroConfig.Get(heroId);
        SkinID = (int)fightObj.SkinID;
        skinConfig = HeroSkinConfig.Get(SkinID);
        heroLevel = (int)fightObj.LV;
    }
    #if UNITY_EDITOR
    public HeroInfo()
    {
        heroId = 520001; // 默认英雄ID
        heroLevel = 1;
        heroStar = 1;
        breakLevel = 1;
        awakeLevel = 1;
        SkinIndex = 0;
        heroConfig = HeroConfig.Get(heroId);
        awakeConfig = HeroAwakeConfig.GetHeroAwakeConfig(heroId, awakeLevel);
        breakConfig = HeroBreakConfig.GetHeroBreakConfig(heroId, breakLevel);
@@ -99,52 +77,41 @@
    }
    #endif
    // public HeroInfo Clone() => JsonMapper.ToObject<HeroInfo>(JsonMapper.ToJson(this));
    public void UpdateHero(ItemModel itemHero)
    public void UpdateHero(ItemModel _itemHero)
    {
        itemHero = _itemHero;
        // HeroConfigUtility
        heroId = itemHero.config.ID;
        // 70 # 英雄等级
        heroLevel = itemHero.GetUseData(70)[0];
        // 72 # 英雄星级
        heroStar = itemHero.GetUseData(72)[0];
        // 74 # 英雄突破等级
        breakLevel = itemHero.GetUseData(74)[0];
        // 76 # 英雄觉醒等级
        awakeLevel = itemHero.GetUseData(76)[0];
        // 78 # 英雄使用的皮肤索引
        SkinIndex = itemHero.GetUseData(78)[0];
        // 71 # 英雄天赋ID列表
        List<int> talentSkillList = itemHero.GetUseData(71);
        // 73 # 英雄天赋ID等级列表,对应71天赋ID的等级
        List<int> talentLvList = itemHero.GetUseData(73);
        // 75 # 英雄天赋洗炼锁定索引列表,对应71天赋ID索引
        List<int> talentLockList = itemHero.GetUseData(75);
        InitConfigs();
        // 71 # 英雄天赋ID列表
        // List<int> talentSkillList = itemHero.GetUseData(71);
        // // 73 # 英雄天赋ID等级列表,对应71天赋ID的等级
        // List<int> talentLvList = itemHero.GetUseData(73);
        // // 75 # 英雄天赋洗炼锁定索引列表,对应71天赋ID索引
        // List<int> talentLockList = itemHero.GetUseData(75);
        if (talentLockList.Count != talentLvList.Count || talentLvList.Count != talentSkillList.Count)
        {
            Debug.LogError("天赋ID列表及后续的数据数量没对上");
        }
        //  天赋
        talentList.Clear();
        for (int i = 0; i < talentSkillList.Count; i++)
        {
            talentList.Add(new HeroTalentInfo(this, talentSkillList[i], talentLvList[i], talentLockList[i]));
        }
        // if (talentLockList.Count != talentLvList.Count || talentLvList.Count != talentSkillList.Count)
        // {
        //     Debug.LogError("天赋ID列表及后续的数据数量没对上");
        // }
        //  羁绊
        fetterInfoList.Clear();
        for (int i = 0; i < heroConfig.FetterIDList.Length; i++)
        {
            fetterInfoList.Add(new HeroFetterInfo(this, heroConfig.FetterIDList[i]));
        }
        // //  天赋
        // talentList.Clear();
        // for (int i = 0; i < talentSkillList.Count; i++)
        // {
        //     talentList.Add(new HeroTalentInfo(this, talentSkillList[i], talentLvList[i], talentLockList[i]));
        // }
        // //  羁绊
        // fetterInfoList.Clear();
        // for (int i = 0; i < heroConfig.FetterIDList.Length; i++)
        // {
        //     fetterInfoList.Add(new HeroFetterInfo(this, heroConfig.FetterIDList[i]));
        // }
// 77 # 英雄天赋洗炼随机ID列表
// 79 # 英雄觉醒时随机天赋选项ID列表
Main/System/Hero/HeroManager.cs
@@ -1,10 +1,17 @@
using System.Collections.Generic;
using UnityEngine;
using System;
using System.Linq;
public class HeroManager : GameSystemManager<HeroManager>
{
    //武将和图鉴的关系
    //同一个武将图鉴,可能有多个武将(物品)数据,或者没有武将,但是有图鉴信息
    //初始创建(0725),后续跟随背包事件增加删除  key = guid
    protected Dictionary<string, HeroInfo> heroInfoDict = new Dictionary<string, HeroInfo>();
    //武将列表界面
    public List<string> heroSortList = new List<string>();
    public Action<HeroInfo> onNewHeroEvent;
@@ -14,57 +21,81 @@
    {
        base.Init();
        //  注册一点事件
        PackManager.Instance.refrechPackEvent += refrechPackEvent;
        PackManager.Instance.CreateItemEvent += CreateHero;
        PackManager.Instance.DeleteItemEvent += DeleteHero;
        DTC0102_tagCDBPlayer.beforePlayerDataInitializeEvent += OnBeforePlayerDataInitialize;
    }
    public override void Release()
    {
        base.Release();
        PackManager.Instance.refrechPackEvent -= refrechPackEvent;
        PackManager.Instance.CreateItemEvent -= CreateHero;
        PackManager.Instance.DeleteItemEvent -= DeleteHero;
        DTC0102_tagCDBPlayer.beforePlayerDataInitializeEvent -= OnBeforePlayerDataInitialize;
    }
    public override void RequestNessaryData()
    void OnBeforePlayerDataInitialize()
    {
        base.RequestNessaryData();
        heroSortList.Clear();
        heroInfoDict.Clear();
    }
    public void refrechPackEvent(PackType packType)
    void refrechPackEvent(PackType packType)
    {
        if (packType == PackType.Hero)
        {
            // bool change = false;
            bool isNew = false;
            //  如果有分批次初始化可能还要麻烦一点?先看看
            bool isInit = heroInfoDict.Count >= 0;
            InitHerosInfo();
        }
    }
            SinglePack heroPack = PackManager.Instance.GetSinglePack(packType);
    void CreateHero(PackType packType, string guid)
    {
        if (packType == PackType.Hero)
        {
            HeroInfo heroInfo = null;
            if (!heroInfoDict.TryGetValue(guid, out heroInfo))
            {
                heroInfo = new HeroInfo(PackManager.Instance.GetItemByGuid(guid));
                heroInfoDict.Add(guid, heroInfo);
            }
            else
            {
                heroInfo.UpdateHero(PackManager.Instance.GetItemByGuid(guid));
            }
        }
    }
    void DeleteHero(PackType packType, string guid)
    {
        if (packType == PackType.Hero)
        {
            if (heroInfoDict.ContainsKey(guid))
            {
                heroInfoDict.Remove(guid);
            }
        }
    }
    public HeroInfo GetHero(string guid)
    {
        if (!heroInfoDict.ContainsKey(guid))
            return null;
        return heroInfoDict[guid];
    }
    void InitHerosInfo()
    {
        heroInfoDict.Clear();
        SinglePack heroPack = PackManager.Instance.GetSinglePack(PackType.Hero);
            Dictionary<int, ItemModel> heroes = heroPack.GetAllItems();
            foreach (ItemModel hero in heroes.Values)
            {
                HeroInfo heroInfo = null;
                if (!heroInfoDict.TryGetValue(hero.guid, out heroInfo))
                {
                    heroInfo = new HeroInfo(hero);
                    heroInfoDict.Add(hero.guid, heroInfo);
                    if (!isInit)
                    {
                        isNew = true;
                        onNewHeroEvent?.Invoke(heroInfo);
                    }
                }
                else
                {
                    heroInfo.UpdateHero(hero);
                    //  也有可能不是change
                    // change = true;
                    // onHeroChangeEvent?.Invoke(heroInfo);
                }
            }
            CreateHero(hero.packType, hero.guid);
        }
    }
@@ -95,9 +126,52 @@
        return retList;
    }
    // public override bool IsNessaryDataReady()
    // {
    //     return true;
    // }
    public bool waitResortHeroList = false;
    //刷新时机, 打开武将界面 或者 关闭功能界面
    public void SortHeroList()
    {
        heroSortList = heroInfoDict.Keys.ToList();
        heroSortList.Sort(CmpHero);
    }
    int CmpHero(string guidA, string guidB)
    {
        HeroInfo heroA = heroInfoDict[guidA];
        HeroInfo heroB = heroInfoDict[guidB];
        if (heroA == null || heroB == null)
        {
            return 0;
        }
        // 排序规则:上阵>武将等级>突破等级>武将觉醒阶级>武将品质>武将吞噬星级>武将ID
        if (heroA.isInMainBattle != heroB.isInMainBattle)
        {
            return heroA.isInMainBattle ? -1 : 1;
        }
        if (heroA.heroLevel != heroB.heroLevel)
        {
            return heroA.heroLevel > heroB.heroLevel ? -1 : 1;
        }
        if (heroA.breakLevel != heroB.breakLevel)
        {
            return heroA.breakLevel > heroB.breakLevel ? -1 : 1;
        }
        if (heroA.awakeLevel != heroB.awakeLevel)
        {
            return heroA.awakeLevel > heroB.awakeLevel ? -1 : 1;
        }
        if (heroA.Quality != heroB.Quality)
        {
            return heroA.Quality > heroB.Quality ? -1 : 1;
        }
        if (heroA.heroStar != heroA.heroStar)
        {
            return heroA.heroStar > heroB.heroStar ? -1 : 1;
        }
        return heroA.heroId.CompareTo(heroB.heroId);
    }
}
Main/System/Hero/UIHeroController.cs
@@ -1,46 +1,40 @@
using System;
using Spine.Unity;
using UnityEngine;
using UnityEngine.Events;
using UnityEngine.EventSystems;
public class UIHeroController : MonoBehaviour
{
    public static UIHeroController Create(HeroSkinConfig skinCfg, Transform _parent = null)
    public void Create(int _skinID, Action _onComplete = null)
    {
        // GameObject battleGO = ResManager.Instance.LoadAsset<GameObject>("Hero/SpineRes", skinCfg == null ? "Hero_001" : skinCfg.SpineRes);
        skinID = _skinID;
        onComplete = _onComplete;
        GameObject battleGO = ResManager.Instance.LoadAsset<GameObject>("Hero/SpineRes", "Hero_001");
        GameObject instanceGO = null;
        if (_parent != null)
        if (!transform.gameObject.activeSelf)
        {
            instanceGO = GameObject.Instantiate(battleGO, _parent);
            transform.SetActive(true);
        }
        else
        {
            instanceGO = GameObject.Instantiate(battleGO);
        }
        UIHeroController heroController = instanceGO.AddMissingComponent<UIHeroController>();
        return heroController;
    }
    protected SkeletonGraphic skeletonGraphic;
    protected Spine.AnimationState spineAnimationState;
    private Spine.TrackEntry currentTrackEntry;
    private UIEventTrigger uiEventTrigger;
    void Awake()
    {
        skeletonGraphic = gameObject.GetComponentInChildren<SkeletonGraphic>(true);
        uiEventTrigger = UIEventTrigger.Get(skeletonGraphic.gameObject);
        uiEventTrigger.OnClick = OnClick;
        instanceGO = GameObject.Instantiate(battleGO, transform);
        skeletonGraphic = instanceGO.GetComponentInChildren<SkeletonGraphic>(true);
        var skinConfig = HeroSkinConfig.Get(skinID);
        skeletonGraphic.skeletonDataAsset = ResManager.Instance.LoadAsset<SkeletonDataAsset>("Hero/SpineRes/" + skinConfig.SpineRes, skinConfig.SpineRes + "_SkeletonData");
        skeletonGraphic.Initialize(true);
        spineAnimationState = skeletonGraphic.AnimationState;
        PlayAnimation(MotionName.idle, true);
        spineAnimationState.Complete += OnAnimationComplete;
    }
    private int skinID;
    protected SkeletonGraphic skeletonGraphic;
    protected Spine.AnimationState spineAnimationState;
    private Spine.TrackEntry currentTrackEntry;
    private Action onComplete;
    void Destroy()
    {
@@ -62,12 +56,7 @@
    /// </summary>
    protected virtual void OnAnimationComplete(Spine.TrackEntry trackEntry)
    {
        // string animation = trackEntry.Animation.Name;
        PlayAnimation(MotionName.idle, true);
        onComplete?.Invoke();
    }
    protected void OnClick(GameObject go,PointerEventData eventData)
    {
        PlayAnimation(MotionName.attack);
    }
}
Main/System/HeroUI.meta
New file
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 6d5260adadfe89e459f603d5e9453cd7
folderAsset: yes
DefaultImporter:
  externalObjects: {}
  userData:
  assetBundleName:
  assetBundleVariant:
Main/System/HeroUI/GiftBaseCell.cs
New file
@@ -0,0 +1,195 @@
using UnityEngine;
using UnityEngine.UI;
using UnityEngine.Events;
public class GiftBaseCell : MonoBehaviour
{
    Image m_QualityBG;
    Image qualityBG
    {
        get
        {
            if (m_QualityBG == null)
            {
                m_QualityBG = this.transform.GetComponent<Image>("Container_GiftCell/qualityIcon");
            }
            return m_QualityBG;
        }
    }
    Button m_GiftBtn;
    Button giftBtn
    {
        get
        {
            if (m_GiftBtn == null)
            {
                m_GiftBtn = this.transform.GetComponent<Button>("Container_GiftCell");
            }
            return m_GiftBtn;
        }
    }
    Text m_GiftName;
    Text giftName
    {
        get
        {
            if (m_GiftName == null)
            {
                m_GiftName = this.transform.GetComponent<Text>("Container_GiftCell/name");
            }
            return m_GiftName;
        }
    }
    Transform m_LvRect;
    Transform lvRect
    {
        get
        {
            if (m_LvRect == null)
            {
                m_LvRect = this.transform.Find("Container_GiftCell/lvrect");
            }
            return m_LvRect;
        }
    }
    Text m_LvText;
    Text lvText
    {
        get
        {
            if (m_LvText == null)
            {
                m_LvText = this.transform.GetComponent<Text>("Container_GiftCell/lv");
            }
            return m_LvText;
        }
    }
    Image m_StateImg;
    Image stateImg
    {
        get
        {
            if (m_StateImg == null)
            {
                m_StateImg = this.transform.GetComponent<Image>("Container_GiftCell/state");
            }
            return m_StateImg;
        }
    }
    void Awake()
    {
        LoadPrefab();
    }
    //showState 0:不显示 1:新增 2:提升
    //giftID 0 :代表未激活灰色 -1:代表不能激活 棕色,其他根据配表
    private void Init(int giftID, int lv, UnityAction onclick = null, int showState = 0)
    {
        if (HeroTalentConfig.HasKey(giftID))
        {
            var config = HeroTalentConfig.Get(giftID);
            qualityBG.SetSprite("GiftQualityBG" + config.Quality);
            giftBtn.AddListener(onclick);
            giftName.text = config.Name;
            lvText.text = lv.ToString();
            lvText.color = GetColor(1);
            Outline textOutline = lvText.GetComponent<Outline>();
            textOutline.effectColor = GetOutlineColor(config.Quality);
            lvRect.SetActive(lv > 0);
            stateImg.SetActive(showState > 0);
            stateImg.SetSprite("GiftState" + showState);
            stateImg.SetNativeSize();
        }
        else
        {
            qualityBG.SetSprite("GiftQualityBG" + giftID);
            giftBtn.RemoveAllListeners();
            giftName.text = string.Empty;
            lvRect.SetActive(false);
            stateImg.SetActive(false);
        }
    }
    Color32 GetColor(int quality)
    {
        if (quality == 1)
        {
            //D196FF
            return new Color32(209, 150, 255, 255);
        }
        else if (quality == 2)
        {
            //ffda8c
            return new Color32(255, 218, 140, 255);
        }
        else if (quality == 3)
        {
            //ffbd88
            return new Color32(255, 189, 136, 255);
        }
        else if (quality == 4)
        {
            //ff8888
            return new Color32(255, 136, 136, 255);
        }
        return new Color32(255, 255, 255, 255);
    }
    Color32 GetOutlineColor(int quality)
    {
        if (quality == 1)
        {
            //692088
            return new Color32(105, 32, 136, 255);
        }
        else if (quality == 2)
        {
            //886220
            return new Color32(136, 98, 32, 255);
        }
        else if (quality == 3)
        {
            //884a20
            return new Color32(136, 74, 32, 255);
        }
        else if (quality == 4)
        {
            //882020
            return new Color32(136, 32, 32, 255);
        }
        return new Color32(255, 255, 255, 255);
    }
    GameObject cellContainer;
    protected void LoadPrefab()
    {
        if (cellContainer != null)
            return;
        var tmp = transform.Find("Container_SkillCell");
        if (tmp != null)
        {
            cellContainer = tmp.gameObject;
            return;
        }
        if (cellContainer == null)
        {
            cellContainer = UIUtility.CreateWidget("SkillBaseCell", "Container_SkillCell");
            if (cellContainer != null)
            {
                cellContainer.transform.SetParentEx(this.transform, Vector3.zero, Quaternion.identity, Vector3.one);
                cellContainer.transform.SetAsFirstSibling();
            }
        }
    }
}
Main/System/HeroUI/GiftBaseCell.cs.meta
copy from Main/System/Hero/HeroInfo.Collection.cs.meta copy to Main/System/HeroUI/GiftBaseCell.cs.meta
File was copied from Main/System/Hero/HeroInfo.Collection.cs.meta
@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 14fc4e08ba34d504a936ff5d6c2b7c53
guid: fee86d39197e04b4ba659962fa508538
MonoImporter:
  externalObjects: {}
  serializedVersion: 2
Main/System/HeroUI/HeroBaseWin.cs
New file
@@ -0,0 +1,75 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
/// <summary>
/// 武将列表
/// </summary>
public class HeroBaseWin : FunctionsBaseWin
{
    [SerializeField] List<Image> funcSelectImgList;
    [SerializeField] List<Image> funcUnSelectImgList;
    /// </summary>
    protected override void InitComponent()
    {
        base.InitComponent();
    }
    protected override void OnPreOpen()
    {
        base.OnPreOpen();
    }
    protected override void OnPreClose()
    {
        base.OnPreClose();
    }
    public override void Refresh()
    {
    }
    protected override void UpdateButtonsState()
    {
        for (int i = 0; i < funcSelectImgList.Count; i++)
        {
            if (i == functionOrder)
            {
                funcSelectImgList[i].SetActive(true);
                funcUnSelectImgList[i].SetActive(false);
            }
            else
            {
                funcSelectImgList[i].SetActive(false);
                funcUnSelectImgList[i].SetActive(true);
            }
        }
    }
    protected override void OpenSubUIByTabIndex()
    {
        Debug.Log("打开子界面 : " + functionOrder);
        // 主城 内政 武将 挑战 公会
        //根据索引打开不同的界面
         switch (functionOrder)
        {
            case 0:
                // 打开主页界面
                currentSubUI = UIManager.Instance.OpenWindow<HeroListWin>();
                break;
            default:
                Debug.LogWarning("未知的标签索引: " + functionOrder);
                break;
        }
    }
}
Main/System/HeroUI/HeroBaseWin.cs.meta
File was renamed from Main/System/Hero/HeroInfo.Collection.cs.meta
@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 14fc4e08ba34d504a936ff5d6c2b7c53
guid: 030a392061d061044b14bec47c7c55ab
MonoImporter:
  externalObjects: {}
  serializedVersion: 2
Main/System/HeroUI/HeroCardCell.cs
New file
@@ -0,0 +1,37 @@
using UnityEngine;
using UnityEngine.UI;
using UnityEngine.Events;
using System.Collections.Generic;
public class HeroCardCell : MonoBehaviour
{
    [SerializeField] Button heroCardBtn;
    [SerializeField] Text lvText;
    [SerializeField] Image countryImg;
    [SerializeField] Image jobImg;
    [SerializeField] UIHeroController heroModel;
    [SerializeField] Image onStateImg;
    [SerializeField] RedpointBehaviour redpoint;
    [SerializeField] Image trainStateImg;
    [SerializeField] Text nameText;
    [SerializeField] Image awakeImg;
    [SerializeField] Text awakeLVText;
    [SerializeField] List<Image> starImgList;
    public void Display(int index)
    {
        var hero = HeroManager.Instance.GetHero(HeroManager.Instance.heroSortList[index]);
        if (hero == null)
        {
            this.gameObject.SetActive(false);
            return;
        }
        this.gameObject.SetActive(true);
        lvText.text = hero.heroLevel.ToString();
        var heroConfig = hero.heroConfig;
        countryImg.SetSprite("herocountry" + hero.heroCountry);
        jobImg.SetSprite("herojob" + heroConfig.Class);
        heroModel.Create(heroConfig.SkinIDList[hero.SkinIndex]);
    }
}
Main/System/HeroUI/HeroCardCell.cs.meta
copy from Main/System/Hero/HeroInfo.Collection.cs.meta copy to Main/System/HeroUI/HeroCardCell.cs.meta
File was copied from Main/System/Hero/HeroInfo.Collection.cs.meta
@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 14fc4e08ba34d504a936ff5d6c2b7c53
guid: 52a97086b2bf17147818d22c88dac66f
MonoImporter:
  externalObjects: {}
  serializedVersion: 2
Main/System/HeroUI/HeroCardLineCell.cs
New file
@@ -0,0 +1,24 @@
using UnityEngine;
using System.Collections.Generic;
public class HeroCardLineCell : CellView
{
    [SerializeField] List<HeroCardCell> cardList;
    public void Display(int index)
    {
        for (int i = 0; i < cardList.Count; i++)
        {
            if (i + index < HeroManager.Instance.heroSortList.Count)
            {
                cardList[i].SetActive(true);
                cardList[i].Display(index);
            }
            else
            {
                cardList[i].SetActive(false);
            }
        }
    }
}
Main/System/HeroUI/HeroCardLineCell.cs.meta
copy from Main/System/Hero/HeroInfo.Collection.cs.meta copy to Main/System/HeroUI/HeroCardLineCell.cs.meta
File was copied from Main/System/Hero/HeroInfo.Collection.cs.meta
@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 14fc4e08ba34d504a936ff5d6c2b7c53
guid: 81637d36456b1a54698c8de938c98bf7
MonoImporter:
  externalObjects: {}
  serializedVersion: 2
Main/System/HeroUI/HeroListWin.cs
New file
@@ -0,0 +1,74 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
/// <summary>
/// 武将列表
/// </summary>
public class HeroListWin : UIBase
{
    [SerializeField] Button heroPackBtn;
    [SerializeField] Text heroPackText;
    [SerializeField] ScrollerController heroListScroller;
    [SerializeField] GameObject heroListEmpty;
    [SerializeField] List<Text> attrOnList; //上阵属性加成
    [SerializeField] GameObject attrOnTip;
    [SerializeField] Button attrOnTipBtn;
    [SerializeField] GameObject foldObject;
    [SerializeField] Button unFoldBtn; //展开按钮
    [SerializeField] List<Button> countryBtnList;
    [SerializeField] GameObject unFoldObject;
    [SerializeField] Button foldBtn; //收起按钮
    [SerializeField] List<Button> jobBtnList;   //全部,输出、肉盾、辅助、控制
    [SerializeField] Button changeHeroPosBtn; //布阵按钮
    private List<Image> countrySelectImgList;
    private List<Image> jobSelectImgList;
    /// </summary>
    protected override void InitComponent()
    {
    }
    protected override void OnPreOpen()
    {
        heroListScroller.OnRefreshCell += OnRefreshCell;
        HeroManager.Instance.SortHeroList();
        CreateScroller();
    }
    protected override void OnPreClose()
    {
        heroListScroller.OnRefreshCell -= OnRefreshCell;
    }
    public override void Refresh()
    {
    }
    void OnRefreshCell(ScrollerDataType type, CellView cell)
    {
        var _cell = cell as HeroCardLineCell;
        _cell.Display(cell.index);
    }
    void CreateScroller()
    {
        heroListScroller.Refresh();
        for (int i = 0; i < HeroManager.Instance.heroSortList.Count; i++)
        {
            heroListScroller.AddCell(ScrollerDataType.Header, i);
        }
        heroListScroller.Restart();
    }
}
Main/System/HeroUI/HeroListWin.cs.meta
copy from Main/System/Hero/HeroInfo.Collection.cs.meta copy to Main/System/HeroUI/HeroListWin.cs.meta
File was copied from Main/System/Hero/HeroInfo.Collection.cs.meta
@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 14fc4e08ba34d504a936ff5d6c2b7c53
guid: fd17368bc8780f9468e0dbd3919f8974
MonoImporter:
  externalObjects: {}
  serializedVersion: 2
Main/System/KnapSack/PackManager.cs
@@ -12,10 +12,7 @@
    public static string StrengthAttrShift_RecordKey = "";
    public const string RecordKnapsackTitle = "RecordKnapsackTitle";
    Dictionary<int, int> DrugToDungeonDict { get; set; }   //key 丹药ID,value副本ID
    Dictionary<int, int[]> DungeonToDrugDict { get; set; }  //key 副本ID,value丹药ID列表
    //public List<AttrFruitConfig> makeDruglist { get; private set; }
    Dictionary<int, Dictionary<int, int>> decomposeAttrDict = new Dictionary<int, Dictionary<int, int>>();
    string RoleEquipLocalSave = "";
    List<int> LocalSavePlaceArray { get; set; }
    Dictionary<int, List<int>> sharedUseCountItemDict { get; set; }
@@ -164,6 +161,8 @@
    }
    public event Action<PackType> refrechPackEvent; //刷新整个背包数据
    public event Action<PackType, string> CreateItemEvent; //得到新物品,可能批量创建注意效率
    public event Action<PackType, string> DeleteItemEvent; //删除物品,可能批量删除注意效率
    public event Action<PackType, int, int> refreshItemCountEvent; // 慎用会卡(单个)最新物品数量刷新(旧的弃用)在得到新物品、物品数量的改变,清理该物品时均会触发 int 位置索引 int物品id
    public event Action<PackType> gridRefreshEvent; //背包空格刷新
    public event Action<PackType, int, int> itemCntAddEvent; //物品数量增加 int 位置索引 int物品id
@@ -336,10 +335,21 @@
        PackType type = (PackType)clearPack.PackIndex;
        SinglePack singlePack = null;
        playerPackDict.TryGetValue(type, out singlePack);
        List<string> guidList = new List<string>();
        if (singlePack != null)
        {
            singlePack.Clear();
            foreach (var item in singlePack.GetAllItems().Values)
            {
                guidList.Add(item.guid);
        }
            singlePack.Clear();
            foreach (var guid in guidList)
            {
                DeleteItemDictByGUID(type, guid);
            }
        }
    }
    public void RemoveItem(H0709_tagClearItem clearItem)
@@ -419,6 +429,10 @@
    {
        itemGUIDDict[itemModel.guid] = itemModel;
        GetItemEventCtrl(itemModel, showNewItem);
        if (showNewItem)
        {
            CreateItemEvent?.Invoke(itemModel.packType, itemModel.guid);
        }
    }
    void DeleteItemDictByGUID(PackType type, string guid)
@@ -428,6 +442,7 @@
            if (itemGUIDDict[guid].packType == type)
            {
                itemGUIDDict.Remove(guid);
                DeleteItemEvent?.Invoke(type, guid);
            }
        }
    }
Main/System/Main/FuncsBaseWin.cs
New file
@@ -0,0 +1,117 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
/// <summary>
/// 多页签界面,管理子界面
/// </summary>
public abstract class FunctionsBaseWin : UIBase
{
    // 标签按钮组
    public Button[] tabButtons;
    // 当前打开的子界面
    protected UIBase currentSubUI;
    /// <summary>
    /// 初始化组件
    /// </summary>
    protected override void InitComponent()
    {
        base.InitComponent();
        // 初始化UI组件事件
        InitButtonEvents();
    }
    protected override void OnPreOpen()
    {
        // 默认选中第一个标签
        SelectBottomTab(functionOrder);
    }
    protected override void OnPreClose()
    {
        CloseCurrentSubUI();
    }
    /// <summary>
    /// 初始化UI组件事件
    /// </summary>
    private void InitButtonEvents()
    {
        // 初始化底部按钮
        for (int i = 0; i < tabButtons.Length; i++)
        {
            int index = i;
            tabButtons[i].AddListener(() =>
            {
                OnTabButtonClicked(index);
            });
        }
    }
    /// <summary>
    /// 选择标签
    /// </summary>
    protected void SelectBottomTab(int index)
    {
        // 如果点击当前已选中的标签,不做处理
        if (functionOrder == index && currentSubUI != null)
        {
            return;
        }
        // 更新当前选中的标签索引
        functionOrder = index;
        // 更新按钮状态
        UpdateButtonsState();
        // 关闭当前打开的子界面
        CloseCurrentSubUI();
        // 根据选中的标签打开对应的界面
        OpenSubUIByTabIndex();
    }
    /// <summary>
    /// 关闭当前打开的子界面
    /// </summary>
    protected void CloseCurrentSubUI()
    {
        if (currentSubUI != null)
        {
            // 关闭当前界面
            currentSubUI.CloseWindow();
            currentSubUI = null;
        }
    }
    /// <summary>
    /// 更新按钮状态
    /// </summary>
    protected abstract void UpdateButtonsState();
    /// <summary>
    /// 根据标签索引打开对应的子界面
    /// </summary>
    protected abstract void OpenSubUIByTabIndex();
    /// <summary>
    /// 标签按钮点击
    /// </summary>
    protected virtual void OnTabButtonClicked(int index)
    {
        SelectBottomTab(index);
    }
}
Main/System/Main/FuncsBaseWin.cs.meta
copy from Main/System/Hero/HeroInfo.Collection.cs.meta copy to Main/System/Main/FuncsBaseWin.cs.meta
File was copied from Main/System/Hero/HeroInfo.Collection.cs.meta
@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 14fc4e08ba34d504a936ff5d6c2b7c53
guid: 1faa0cf7a4ac2bf47bf9487e886af510
MonoImporter:
  externalObjects: {}
  serializedVersion: 2
Main/System/Main/HomeWin.cs
@@ -4,17 +4,10 @@
using UnityEngine.UI;
/// <summary>
/// 游戏主界面
/// 游戏主界面(主战斗场景)
/// </summary>
public class HomeWin : UIBase
{
    //头像区
    [SerializeField] AvatarCell avatarCell;
    [SerializeField] Text playerNameText;
    [SerializeField] Text powerText;
    [SerializeField] OfficialTitleCell officialRankText;
    [SerializeField] Text goldText;
    [SerializeField] Text sparText;
    //经验区
    [SerializeField] Text playerLevelText;
@@ -37,7 +30,6 @@
    /// </summary>
    protected override void InitComponent()
    {
        avatarCell.button.AddListener(() => { });
        taskButton.AddListener(OnClickTaskButton);
        bossBtn.AddListener(() =>
        {
@@ -51,7 +43,6 @@
    public override void Refresh()
    {
        UpdatePlayerInfo();
        UpdateCurrency();
        UpdateTask();
    }
@@ -60,42 +51,32 @@
        PlayerDatas.Instance.playerDataRefreshEvent += PlayerDataRefresh;
        TaskManager.Instance.OnTaskUpdate += UpdateTask;
        Refresh();
        UIManager.Instance.OpenWindow<BattleWin>();
    }
    protected override void OnOpen()
    {
        base.OnOpen();
    }
    protected override void OnPreClose()
    {
        PlayerDatas.Instance.playerDataRefreshEvent -= PlayerDataRefresh;
        TaskManager.Instance.OnTaskUpdate -= UpdateTask;
        UIManager.Instance.CloseWindow<BattleWin>();
    }
    void PlayerDataRefresh(PlayerDataType type)
    {
        switch (type)
        {
            case PlayerDataType.FightPower:
                powerText.text = UIHelper.ReplaceLargeArtNum(PlayerDatas.Instance.baseData.FightPoint);
                break;
            case PlayerDataType.RealmLevel:
                officialRankText.InitUI(PlayerDatas.Instance.baseData.realmLevel, PlayerDatas.Instance.baseData.TitleID);
                break;
            case PlayerDataType.TotalExp:
            case PlayerDataType.ExpPoint:
                ShowExp();
                break;
            case PlayerDataType.Gold:
                goldText.text = UIHelper.GetMoneyCntEx(1).ToString();
                break;
            case PlayerDataType.default33:
                sparText.text = UIHelper.GetMoneyCnt(42).ToString();
                break;
            case PlayerDataType.LV:
                playerLevelText.text = PlayerDatas.Instance.baseData.LV.ToString();
                break;
            case PlayerDataType.Face:
            case PlayerDataType.FacePic:
                avatarCell.InitUI(AvatarHelper.GetAvatarModel((int)PlayerDatas.Instance.baseData.PlayerID,
                                                                PlayerDatas.Instance.baseData.face,
                                                                PlayerDatas.Instance.baseData.facePic));
                break;
        }
@@ -107,17 +88,7 @@
    /// </summary>
    private void UpdatePlayerInfo()
    {
        // 从玩家数据中获取信息并更新UI
        avatarCell.InitUI(AvatarHelper.GetAvatarModel((int)PlayerDatas.Instance.baseData.PlayerID,
                                                        PlayerDatas.Instance.baseData.face,
                                                        PlayerDatas.Instance.baseData.facePic));
        playerNameText.text = PlayerDatas.Instance.baseData.PlayerName;
        playerLevelText.text = PlayerDatas.Instance.baseData.LV.ToString();
        powerText.text = UIHelper.ReplaceLargeArtNum(PlayerDatas.Instance.baseData.FightPoint);
        officialRankText.InitUI(PlayerDatas.Instance.baseData.realmLevel, PlayerDatas.Instance.baseData.TitleID);
        ShowExp();
    }
@@ -129,14 +100,6 @@
        expSlider.Text.text = PlayerDatas.Instance.baseData.curExp + "/" + PlayerLVConfig.Get(PlayerDatas.Instance.baseData.LV).EXP;
    }
    /// <summary>
    /// 更新货币信息
    /// </summary>
    private void UpdateCurrency()
    {
        goldText.text = UIHelper.GetMoneyCntEx(1).ToString();
        sparText.text = UIHelper.ReplaceLargeNumEx(UIHelper.GetMoneyCnt(42));
    }
    void UpdateTask()
    { 
Main/System/Main/MainWin.cs
@@ -6,57 +6,36 @@
/// <summary>
/// 游戏主界面底部功能按钮
/// </summary>
public class MainWin : UIBase
public class MainWin : FunctionsBaseWin
{
    // 底部按钮组
    public Button[] bottomTabButtons;
        //头像区
    [SerializeField] AvatarCell avatarCell;
    [SerializeField] Text playerNameText;
    [SerializeField] Text powerText;
    [SerializeField] OfficialTitleCell officialRankText;
    [SerializeField] Text goldText;
    [SerializeField] Text sparText;
    public Text hammerText;
    // 当前选中的底部标签索引
    private int currentTabIndex = 0;
    // 当前打开的子界面
    private UIBase currentSubUI;
    /// <summary>
    /// 初始化组件
    /// </summary>
    protected override void InitComponent()
    {
        base.InitComponent();
        // 初始化UI组件事件
        InitButtonEvents();
    }
    /// <summary>
    /// 初始化UI组件事件
    /// </summary>
    private void InitButtonEvents()
    {
        // 初始化底部按钮
        for (int i = 0; i < bottomTabButtons.Length; i++)
        {
            int index = i; // 捕获索引
            bottomTabButtons[i].onClick.AddListener(() => {
                OnBottomTabButtonClicked(index);
            });
        }
        avatarCell.button.AddListener(() => { });
    }
    
    public override void Refresh()
    {
        UpdateCurrency();
        UpdatePlayerInfo();
    }
    protected override void OnPreOpen()
    {
        PlayerDatas.Instance.playerDataRefreshEvent += PlayerDataRefresh;
        // 默认选中第一个标签
        SelectBottomTab(0);
        base.OnPreOpen();
        // 刷新UI
        Refresh();
@@ -65,14 +44,54 @@
    protected override void OnPreClose()
    {
        PlayerDatas.Instance.playerDataRefreshEvent -= PlayerDataRefresh;
        base.OnPreClose();
    }
    /// <summary>
    /// 更新玩家信息
    /// </summary>
    private void UpdatePlayerInfo()
    {
        // 从玩家数据中获取信息并更新UI
        avatarCell.InitUI(AvatarHelper.GetAvatarModel((int)PlayerDatas.Instance.baseData.PlayerID,
                                                        PlayerDatas.Instance.baseData.face,
                                                        PlayerDatas.Instance.baseData.facePic));
        playerNameText.text = PlayerDatas.Instance.baseData.PlayerName;
        powerText.text = UIHelper.ReplaceLargeArtNum(PlayerDatas.Instance.baseData.FightPoint);
        officialRankText.InitUI(PlayerDatas.Instance.baseData.realmLevel, PlayerDatas.Instance.baseData.TitleID);
    }
    void PlayerDataRefresh(PlayerDataType type)
    {
        if (type == PlayerDataType.default26)
        switch (type)
        {
            UpdateCurrency();
            case PlayerDataType.FightPower:
                powerText.text = UIHelper.ReplaceLargeArtNum(PlayerDatas.Instance.baseData.FightPoint);
                break;
            case PlayerDataType.RealmLevel:
                officialRankText.InitUI(PlayerDatas.Instance.baseData.realmLevel, PlayerDatas.Instance.baseData.TitleID);
                break;
            case PlayerDataType.Gold:
                goldText.text = UIHelper.GetMoneyCntEx(1).ToString();
                break;
            case PlayerDataType.default33:
                sparText.text = UIHelper.GetMoneyCnt(42).ToString();
                break;
            case PlayerDataType.Face:
            case PlayerDataType.FacePic:
                avatarCell.InitUI(AvatarHelper.GetAvatarModel((int)PlayerDatas.Instance.baseData.PlayerID,
                                                                PlayerDatas.Instance.baseData.face,
                                                                PlayerDatas.Instance.baseData.facePic));
                break;
            case PlayerDataType.default26:
                hammerText.text = UIHelper.GetMoneyCnt(41).ToString();
                break;
        }
    }
    
@@ -82,12 +101,14 @@
    private void UpdateCurrency()
    {
        hammerText.text = UIHelper.GetMoneyCnt(41).ToString();
        goldText.text = UIHelper.GetMoneyCntEx(1).ToString();
        sparText.text = UIHelper.ReplaceLargeNumEx(UIHelper.GetMoneyCnt(42));
    }
    
    /// <summary>
    /// 底部标签按钮点击
    /// </summary>
    private void OnBottomTabButtonClicked(int index)
    protected override void OnTabButtonClicked(int index)
    {
        if (index == 0)
        { 
@@ -99,66 +120,33 @@
        SelectBottomTab(index);
    }
    
    /// <summary>
    /// 选择底部标签
    /// </summary>
    private void SelectBottomTab(int index)
    {
        // 如果点击当前已选中的标签,不做处理
        if (currentTabIndex == index && currentSubUI != null)
        {
            return;
        }
        
        // 更新当前选中的标签索引
        currentTabIndex = index;
        // 更新按钮状态
        UpdateButtonsState();
        // 关闭当前打开的子界面
        CloseCurrentSubUI();
        // 根据选中的标签打开对应的界面
        OpenSubUIByTabIndex(index);
    }
    
    /// <summary>
    /// 更新按钮状态
    /// </summary>
    private void UpdateButtonsState()
    protected override void UpdateButtonsState()
    {
        // 遍历所有按钮,设置选中状态
        for (int i = 0; i < bottomTabButtons.Length; i++)
        {
        // for (int i = 0; i < tabButtons.Length; i++)
        // {
            // bottomTabButtons[i].image.color = (i == currentTabIndex) ?  Color.white : Color.gray;
        }
        //     // bottomTabButtons[i].image.color = (i == currentTabIndex) ?  Color.white : Color.gray;
        // }
    }
    
    /// <summary>
    /// 关闭当前打开的子界面
    /// </summary>
    private void CloseCurrentSubUI()
    {
        if (currentSubUI != null)
        {
            // 关闭当前界面
            currentSubUI.CloseWindow();
            currentSubUI = null;
        }
    }
    /// <summary>
    /// 根据标签索引打开对应的子界面
    /// </summary>
    private void OpenSubUIByTabIndex(int index)
    protected override void OpenSubUIByTabIndex()
    {
        Debug.Log("打开子界面 : " + index);
        Debug.Log("打开子界面 : " + functionOrder);
        // 主城 内政 武将 挑战 公会
        //根据索引打开不同的界面
         switch (index)
         switch (functionOrder)
        {
            case 0:
                // 打开主页界面
@@ -167,24 +155,22 @@
                break;
            case 1:
                // currentSubUI = UIManager.Instance.OpenUI<CharacterUI>();
                Debug.Log("打开阵容界面");
                Debug.Log("打开内政界面");
                break;
            case 2:
                // currentSubUI = UIManager.Instance.OpenUI<BagUI>();
                Debug.Log("打开同盟界面");
                currentSubUI = UIManager.Instance.OpenWindow<HeroBaseWin>(0);
                Debug.Log("打开武将界面");
                break;
            case 3:
                // currentSubUI = UIManager.Instance.OpenUI<QuestUI>();
                Debug.Log("打开福利界面");
                Debug.Log("打开挑战界面");
                break;
            case 4:
                //currentSubUI = UIManager.Instance.OpenWindow<PlaceWin>();
                Debug.Log("打开冒险界面");
                BattleWin battleWin = UIManager.Instance.OpenWindow<BattleWin>();
                currentSubUI = battleWin;
                Debug.Log("打开公会界面");
                break;
            default:
                Debug.LogWarning("未知的标签索引: " + index);
                Debug.LogWarning("未知的标签索引: " + functionOrder);
                break;
        }
    }
Main/System/Tip/PowerAddWin.cs
@@ -18,18 +18,7 @@
    [SerializeField] UIFrame uiFrame;
    //[SerializeField] List<PowerUpPosition> powerUpPositions;
    [Header("淡入变大")]
    [SerializeField] Vector3 startVector;                       //起始大小
    [SerializeField] float fadeInToBigDuration;                 //淡入变大动画完成时间
    [SerializeField] Ease fadeInToBigEaseType;
    [SerializeField] Vector3 fadeInToBigVector;                 //淡入变大目标大小
    [Header("淡入变小")]
    [SerializeField] Vector3 fadeInToSmallVector;               //淡入变小目标大小
    [SerializeField] float fadeInToSmallDuration;               //淡入变小动画完成时间
    [SerializeField] Ease fadeInToSmallEaseType;
    [Header("淡入后移动开始前等待时间/s")]
    [SerializeField] float moveStartWaitTime;
@@ -53,16 +42,6 @@
    [Header("移动结束后淡出开始前等待时间/s")]
    [SerializeField] float moveEndWaitTime;
    [Header("淡出变大")]
    [SerializeField] Vector3 fadeOutToBigVector;                //淡出变大目标大小
    [SerializeField] float fadeOutToBigDuration;                //淡出变大动画完成时间
    [SerializeField] Ease fadeOutToBigEaseType;
    [Header("淡出变小")]
    [SerializeField] float fadeOutToSmallDuration;              //淡出变小动画完成时间
    [SerializeField] Ease fadeOutToSmallEaseType;
    [Header("战力数字位置计算相关")]
    [SerializeField] float txtBaseMultiple;                     //前置的战力数字字母距离倍数
@@ -108,7 +87,15 @@
        PlayerMainDate.Instance.AddPowerEvent -= ResetToWaitMove;
    }
    protected override void OnOpenAnimationComplete()
    {
        fadeInEndTime = Time.time;
        nowState = AnimeState.WaitMove;
        uiFrame.SetActive(true);
        uiFrame.SetLoopCount(1);
        uiFrame.ResetFrame(uiFrameKey);
    }
    #endregion
@@ -168,14 +155,9 @@
        }
        else if (nowState == AnimeState.WaitFadeOut)
        {
            if (Time.time - moveEndTime > moveEndWaitTime)
            {
                nowState = AnimeState.FadeOut;
                fadeOutSequence = DOTween.Sequence();
                fadeOutSequence.Append(transZhanLi.DOScale(fadeOutToBigVector, fadeOutToBigDuration).SetEase(fadeOutToBigEaseType));
                fadeOutSequence.Append(transZhanLi.DOScale(startVector, fadeOutToSmallDuration).SetEase(fadeOutToSmallEaseType).OnComplete(CloseWindow));
            CloseWindow();
            }
        }
    }
    private void ResetToFadeIn()
@@ -186,25 +168,12 @@
        uiFrame.SetActive(false);
        fadeInEndTime = 0;
        moveEndTime = 0;
        transZhanLi.transform.localScale = startVector;
        CheckPosition();
        SetNum();
        SetInitPosition(basePower, changePower, isAdd);
        ResetColorA();
        DisplayNum();
        nowState = AnimeState.FadeIn;
        transZhanLi.DOScale(fadeInToBigVector, fadeInToBigDuration).SetEase(fadeInToBigEaseType).OnComplete(() =>
        {
            transZhanLi.DOScale(fadeInToSmallVector, fadeInToSmallDuration).SetEase(fadeInToSmallEaseType).OnComplete(() =>
            {
                fadeInEndTime = Time.time;
                nowState = AnimeState.WaitMove;
                uiFrame.SetActive(true);
                uiFrame.SetLoopCount(1);
                uiFrame.ResetFrame(uiFrameKey);
            });
        });
    }
    private void ResetToWaitMove()
@@ -215,7 +184,6 @@
        uiFrame.SetActive(false);
        fadeInEndTime = Time.time;
        moveEndTime = 0;
        transZhanLi.transform.localScale = fadeInToSmallVector;
        SetNum();
        SetInitPosition(basePower, changePower, isAdd);
        ResetColorA();
Main/Utility/EnumHelper.cs
@@ -721,7 +721,7 @@
    default41,  // 269 过期型代金券
    default42,  // 270 仙缘积分
    default43,  // 271 幻境阁积分
    default44,
    default44,  // 272 武将招募积分
    default45,
    default46,
    default47,
Main/Utility/UIHelper.cs
@@ -1193,6 +1193,11 @@
                    //幻境阁积分
                    return PlayerDatas.Instance.GetPlayerDataByType(PlayerDataType.default43);
                }
            case 51:
                {
                    //武将招募积分
                    return PlayerDatas.Instance.GetPlayerDataByType(PlayerDataType.default44);
                }
            case 98:
                {
                    //过期型代金券