81 子 【常规】背包 / 【常规】背包-客户端 - 背包界面
122 子 【武将】武将系统 / 【武将】武将系统-客户端 - 布阵新封包
15个文件已修改
8个文件已添加
7016 ■■■■ 已修改文件
Main/Config/Configs/ItemConfig.cs 255 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/Core/NetworkPackage/DTCFile/ServerPack/HB1_Role/DTCB124_tagSCLineupInfo.cs 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/Core/NetworkPackage/DTCFile/ServerPack/HB1_Role/DTCB124_tagSCLineupInfo.cs.meta 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/Core/NetworkPackage/DataToCtl/PackageRegedit.cs 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/Core/NetworkPackage/ServerPack/HB1_Role/HB124_tagSCLineupInfo.cs 33 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/Core/NetworkPackage/ServerPack/HB1_Role/HB124_tagSCLineupInfo.cs.meta 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/ResModule/UILoader.cs 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/System/ItemTip/ItemTipUtility.cs 3816 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/System/ItemTip/ItemTipWin.cs 27 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/System/ItemTip/ItemTipWin.cs.meta 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/System/KnapSack/Logic/ComposeGirdCell.cs 25 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/System/KnapSack/Logic/ComposeGirdCell.cs.meta 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/System/KnapSack/Logic/ItemLogicUtility.cs 2590 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/System/KnapSack/Logic/PackGirdCell.cs 9 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/System/KnapSack/Logic/PackGirdCell.cs.meta 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/System/KnapSack/Logic/RolePackWin.cs 26 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/System/KnapSack/Logic/SinglePack.cs 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/System/KnapSack/Logic/composeLineCell.cs 18 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/System/KnapSack/New/CommonItemBaisc.cs 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/System/KnapSack/PackManager.cs 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/System/Main/HomeWin.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/System/Team/TeamManager.cs 122 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/Utility/ComponentExtersion.cs 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/Config/Configs/ItemConfig.cs
@@ -20,21 +20,11 @@
    public string ItemName;
    public int Type;
    public int EquipPlace;
    public int CanRepair;
    public int PackCount;
    public int UseLV;
    public int CanSell;
    public int CanTrade;
    public int[] JumpComposeCondi;
    public int CanDrop;
    public int CanBind;
    public int CDTypeEx;
    public int CDType;
    public int CDTime;
    public int GoldPrice;
    public int GoldPaperPrice;
    public int SilverPrice;
    public int UseTag;
    public int Effect1;
    public int EffectValueA1;
    public int EffectValueB1;
@@ -58,34 +48,17 @@
    public int AddSkill1;
    public int AddSkill2;
    public int JobLimit;
    public int RealmLimit;
    public int ItemColor;
    public int StarLevel;
    public int MaxHoleCount;
    public int CanBreak;
    public int MaxEndure;
    public int EndureReduceType;
    public int BindType;
    public int MaxSkillCnt;
    public int ExpireTime;
    public int MaxFitLV;
    public int SuiteiD;
    public string DropinstantEffName;
    public string IconKey;
    public int ChangeOrd;
    public string Description;
    public string QualityName;
    public int LimitSTR;
    public int LimitPHY;
    public int LimitPNE;
    public string Template;
    public int DropItemPattern;
    public int SellTip;
    public int BatchUse;
    public int Jump;
    public int[] GetWay;
    public string ItemTypeName;
    public int[] UseCondiType;
    public int BaseEffectID;
    public override int LoadKey(string _key)
@@ -108,151 +81,89 @@
            int.TryParse(tables[4],out EquipPlace); 
            int.TryParse(tables[5],out CanRepair);
            int.TryParse(tables[5],out PackCount);
            int.TryParse(tables[6],out PackCount);
            int.TryParse(tables[6],out UseLV);
            int.TryParse(tables[7],out UseLV);
            int.TryParse(tables[7],out CDTypeEx);
            int.TryParse(tables[8],out CanSell);
            int.TryParse(tables[8],out CDType);
            int.TryParse(tables[9],out CanTrade);
            int.TryParse(tables[9],out CDTime);
            if (tables[10].Contains("["))
            int.TryParse(tables[10],out Effect1);
            int.TryParse(tables[11],out EffectValueA1);
            int.TryParse(tables[12],out EffectValueB1);
            int.TryParse(tables[13],out EffectValueC1);
            int.TryParse(tables[14],out Effect2);
            int.TryParse(tables[15],out EffectValueA2);
            int.TryParse(tables[16],out EffectValueB2);
            int.TryParse(tables[17],out EffectValueC2);
            int.TryParse(tables[18],out Effect3);
            int.TryParse(tables[19],out EffectValueA3);
            int.TryParse(tables[20],out EffectValueB3);
            int.TryParse(tables[21],out EffectValueC3);
            int.TryParse(tables[22],out Effect4);
            int.TryParse(tables[23],out EffectValueA4);
            int.TryParse(tables[24],out EffectValueB4);
            int.TryParse(tables[25],out EffectValueC4);
            int.TryParse(tables[26],out Effect5);
            int.TryParse(tables[27],out EffectValueA5);
            int.TryParse(tables[28],out EffectValueB5);
            int.TryParse(tables[29],out EffectValueC5);
            int.TryParse(tables[30],out AddSkill1);
            int.TryParse(tables[31],out AddSkill2);
            int.TryParse(tables[32],out JobLimit);
            int.TryParse(tables[33],out ItemColor);
            int.TryParse(tables[34],out StarLevel);
            int.TryParse(tables[35],out EndureReduceType);
            int.TryParse(tables[36],out MaxSkillCnt);
            int.TryParse(tables[37],out ExpireTime);
            int.TryParse(tables[38],out SuiteiD);
            IconKey = tables[39];
            Description = tables[40];
            int.TryParse(tables[41],out BatchUse);
            int.TryParse(tables[42],out Jump);
            if (tables[43].Contains("["))
            {
                JumpComposeCondi = JsonMapper.ToObject<int[]>(tables[10]);
                GetWay = JsonMapper.ToObject<int[]>(tables[43]);
            }
            else
            {
                string[] JumpComposeCondiStringArray = tables[10].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries);
                JumpComposeCondi = new int[JumpComposeCondiStringArray.Length];
                for (int i=0;i<JumpComposeCondiStringArray.Length;i++)
                {
                     int.TryParse(JumpComposeCondiStringArray[i],out JumpComposeCondi[i]);
                }
            }
            int.TryParse(tables[11],out CanDrop);
            int.TryParse(tables[12],out CanBind);
            int.TryParse(tables[13],out CDTypeEx);
            int.TryParse(tables[14],out CDType);
            int.TryParse(tables[15],out CDTime);
            int.TryParse(tables[16],out GoldPrice);
            int.TryParse(tables[17],out GoldPaperPrice);
            int.TryParse(tables[18],out SilverPrice);
            int.TryParse(tables[19],out UseTag);
            int.TryParse(tables[20],out Effect1);
            int.TryParse(tables[21],out EffectValueA1);
            int.TryParse(tables[22],out EffectValueB1);
            int.TryParse(tables[23],out EffectValueC1);
            int.TryParse(tables[24],out Effect2);
            int.TryParse(tables[25],out EffectValueA2);
            int.TryParse(tables[26],out EffectValueB2);
            int.TryParse(tables[27],out EffectValueC2);
            int.TryParse(tables[28],out Effect3);
            int.TryParse(tables[29],out EffectValueA3);
            int.TryParse(tables[30],out EffectValueB3);
            int.TryParse(tables[31],out EffectValueC3);
            int.TryParse(tables[32],out Effect4);
            int.TryParse(tables[33],out EffectValueA4);
            int.TryParse(tables[34],out EffectValueB4);
            int.TryParse(tables[35],out EffectValueC4);
            int.TryParse(tables[36],out Effect5);
            int.TryParse(tables[37],out EffectValueA5);
            int.TryParse(tables[38],out EffectValueB5);
            int.TryParse(tables[39],out EffectValueC5);
            int.TryParse(tables[40],out AddSkill1);
            int.TryParse(tables[41],out AddSkill2);
            int.TryParse(tables[42],out JobLimit);
            int.TryParse(tables[43],out RealmLimit);
            int.TryParse(tables[44],out ItemColor);
            int.TryParse(tables[45],out StarLevel);
            int.TryParse(tables[46],out MaxHoleCount);
            int.TryParse(tables[47],out CanBreak);
            int.TryParse(tables[48],out MaxEndure);
            int.TryParse(tables[49],out EndureReduceType);
            int.TryParse(tables[50],out BindType);
            int.TryParse(tables[51],out MaxSkillCnt);
            int.TryParse(tables[52],out ExpireTime);
            int.TryParse(tables[53],out MaxFitLV);
            int.TryParse(tables[54],out SuiteiD);
            DropinstantEffName = tables[55];
            IconKey = tables[56];
            int.TryParse(tables[57],out ChangeOrd);
            Description = tables[58];
            QualityName = tables[59];
            int.TryParse(tables[60],out LimitSTR);
            int.TryParse(tables[61],out LimitPHY);
            int.TryParse(tables[62],out LimitPNE);
            Template = tables[63];
            int.TryParse(tables[64],out DropItemPattern);
            int.TryParse(tables[65],out SellTip);
            int.TryParse(tables[66],out BatchUse);
            int.TryParse(tables[67],out Jump);
            if (tables[68].Contains("["))
            {
                GetWay = JsonMapper.ToObject<int[]>(tables[68]);
            }
            else
            {
                string[] GetWayStringArray = tables[68].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries);
                string[] GetWayStringArray = tables[43].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries);
                GetWay = new int[GetWayStringArray.Length];
                for (int i=0;i<GetWayStringArray.Length;i++)
                {
@@ -260,23 +171,7 @@
                }
            }
            ItemTypeName = tables[69];
            if (tables[70].Contains("["))
            {
                UseCondiType = JsonMapper.ToObject<int[]>(tables[70]);
            }
            else
            {
                string[] UseCondiTypeStringArray = tables[70].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries);
                UseCondiType = new int[UseCondiTypeStringArray.Length];
                for (int i=0;i<UseCondiTypeStringArray.Length;i++)
                {
                     int.TryParse(UseCondiTypeStringArray[i],out UseCondiType[i]);
                }
            }
            int.TryParse(tables[71],out BaseEffectID);
            int.TryParse(tables[44],out BaseEffectID);
        }
        catch (Exception exception)
        {
Main/Core/NetworkPackage/DTCFile/ServerPack/HB1_Role/DTCB124_tagSCLineupInfo.cs
New file
@@ -0,0 +1,13 @@
using UnityEngine;
using System.Collections;
// B1 24 阵容信息 #tagSCLineupInfo
public class DTCB124_tagSCLineupInfo : DtcBasic {
    public override void Done(GameNetPackBasic vNetPack)
    {
        base.Done(vNetPack);
        HB124_tagSCLineupInfo vNetData = vNetPack as HB124_tagSCLineupInfo;
        TeamManager.Instance.OnHeroChangeEvent(vNetData);
    }
}
Main/Core/NetworkPackage/DTCFile/ServerPack/HB1_Role/DTCB124_tagSCLineupInfo.cs.meta
New file
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: c1fd0ec2c9c912c459b80695e2be32fb
MonoImporter:
  externalObjects: {}
  serializedVersion: 2
  defaultReferences: []
  executionOrder: 0
  icon: {instanceID: 0}
  userData:
  assetBundleName:
  assetBundleVariant:
Main/Core/NetworkPackage/DataToCtl/PackageRegedit.cs
@@ -102,6 +102,7 @@
        Register(typeof(H0407_tagNPCDisappear), typeof(DTC0407_tagNPCDisappear));
        Register(typeof(H0423_tagObjPropertyRefreshView), typeof(DTC0423_tagObjPropertyRefreshView));
        Register(typeof(H0604_tagUseSkillAttack), typeof(DTC0604_tagUseSkillAttack));
        Register(typeof(HB124_tagSCLineupInfo), typeof(DTCB124_tagSCLineupInfo));
    }
    //主工程注册封包
Main/Core/NetworkPackage/ServerPack/HB1_Role/HB124_tagSCLineupInfo.cs
New file
@@ -0,0 +1,33 @@
using UnityEngine;
using System.Collections;
// B1 24 阵容信息 #tagSCLineupInfo
public class HB124_tagSCLineupInfo : GameNetPackBasic {
    public byte LineupCnt;
    public  tagSCLineup[] LineupList;
    public HB124_tagSCLineupInfo () {
        _cmd = (ushort)0xB124;
    }
    public override void ReadFromBytes (byte[] vBytes) {
        TransBytes (out LineupCnt, vBytes, NetDataType.BYTE);
        LineupList = new tagSCLineup[LineupCnt];
        for (int i = 0; i < LineupCnt; i ++) {
            LineupList[i] = new tagSCLineup();
            TransBytes (out LineupList[i].LineupID, vBytes, NetDataType.BYTE);
            TransBytes (out LineupList[i].ShapeType, vBytes, NetDataType.BYTE);
            TransBytes (out LineupList[i].HeroCnt, vBytes, NetDataType.BYTE);
            TransBytes (out LineupList[i].HeroItemIndexList, vBytes, NetDataType.WORD, LineupList[i].HeroCnt);
        }
    }
    public struct tagSCLineup {
        public byte LineupID;        // 阵容ID
        public byte ShapeType;        // 阵型
        public byte HeroCnt;
        public  ushort[] HeroItemIndexList;        // 所在武将背包索引+1列表 [站位1物品索引+1, 站位2, ...],站位无武将时为0
    }
}
Main/Core/NetworkPackage/ServerPack/HB1_Role/HB124_tagSCLineupInfo.cs.meta
New file
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 3a1dae8baba38b64b823a74ae91865ed
MonoImporter:
  externalObjects: {}
  serializedVersion: 2
  defaultReferences: []
  executionOrder: 0
  icon: {instanceID: 0}
  userData:
  assetBundleName:
  assetBundleVariant:
Main/ResModule/UILoader.cs
@@ -24,6 +24,7 @@
        ResManager.Instance.UnloadAsset(ResourcesPath.UI_PREFAB_SUFFIX, _assetName);
    }
    //通过ICON表加载
    public static Sprite LoadSprite(string _iconKey)
    {
        var iconConfig = IconConfig.Get(_iconKey);
Main/System/ItemTip/ItemTipUtility.cs
@@ -8,324 +8,455 @@
using System.Collections.Generic;
using System.Linq;
    public class ItemTipUtility
public class ItemTipUtility
{
    public enum TipType
    {
        public enum TipType
        Item,
        Equip,
        Dogz,
        GatherSoul, //废弃
        KingTreasure, //王者法宝tip
        PetMount,
        SpiritWeapon,
        PeerlessChest,
        TreasureShow, //其他法宝tip
        BoxItem,    //宝箱物品
        TreasurePavilion, //古宝物品(碎片)
    }
    public class TipData
    {
        public string guid;
        public int itemId;
        public int goodId;
        public int exchangeItemId;
        public BaseInfo baseInfo;
        public BaseProperty baseProperty;
        public BaseProperty petMountBaseProperty;
        public SpiritWeaponProperty spiritWeaponProperty;
        public ShenProperty shenProperty;
        public LegendProperty legendProperty;
        public SkillInfo skillInfo;
        public SuitInfo suitInfo;
        public StarInfo starInfo;
        public StrengthenProperty strengthenProperty;
        public GemInfo gemInfo;
        public TrainProperty trainProperty;
        public List<ItemOperateType> operates;
        public WingRefineMaterials refineMaterials;
        public GetWay getWay;
    }
    public struct BaseInfo
    {
        public int itemId;
        public int count;
        public bool isAuction;
        public bool isEquiped;
        public bool isPreview;
        public int star;
        public int strengthenLevel;
        public int score;
        public bool isOverdue;
        public int auctionSurplusTime;
        public int overdueSurplusTime;
        public int levelLimit;
        public int moneyLimit;
        public int evolveLevel;
    }
    public struct BaseProperty
    {
        public List<Int2> baseProperties;
        public int star;
        public List<Int2> starProperties;
    }
    public struct SpiritWeaponProperty
    {
        public int itemId;
        public List<Int3> properties;
    }
    public struct LegendProperty
    {
        public bool isPreview;
        public int itemId;
        public int trueCount;
        public List<Int2> properties;
        public int score;
    }
    //神装属性
    public struct ShenProperty
    {
        public bool isPreview;
        public int itemId;
        public List<Int3> properties;
    }
    public struct SuitInfo
    {
        public int job;
        public string name;
        public int level;
        public int maxSuitLevel;
        public List<int> places;
        public Dictionary<int, int> placeStars;
        // public Dictionary<int, EquipSuitPropertyEntry> twoSuitProperties;
        //  public Dictionary<int, EquipSuitPropertyEntry> fiveSuitProperties;
        public Dictionary<int, bool> eightSuits;
    }
    public struct StarInfo
    {
        public Int2 equipPosition;
        public int starLevel;
        public int maxLevel;
    }
    public struct StrengthenProperty
    {
        public int strengthenLevel;
        public List<Int2> properties;
        public int evolveLevel;
        public int equipPlace;
    }
    public struct GemInfo
    {
        public Dictionary<int, bool> activeStates;
        public Dictionary<int, int> gems;
    }
    public struct TrainProperty
    {
        public int level;
        public List<Int2> properties;
    }
    public struct SkillInfo
    {
        public List<int> skills;
    }
    public struct WingRefineMaterials
    {
        public List<Int2> materials;
    }
    public struct GetWay
    {
        public bool defaultUnfold;
        public int itemId;
        public List<int> ways;
    }
    public struct CustomEquipInfo
    {
        public int job;
        public int itemId;
        public int score;
        public bool isEquiped;
        public List<Int2> legendProperties;
        public List<int> suitPlaces;
        public Dictionary<int, int> placeStars;
        // public Dictionary<EquipSuitType, int> suitLevels;
        public int strengthenLevel;
        public int starLevel;
        public List<Int2> trainProperties;
        public Dictionary<int, bool> gemHoleActiveStates;
        public Dictionary<int, int> gems;
        public List<int> equipSkillList;
        public int evolveLevel;
    }
    public struct CustomItemPlus
    {
        public int ItemID;
        public int count;
        public int Equipped;
        public int Preview;
        public int Star;
        public int PlusLV;
        public int EvolveLV;
        public string UserData;
        public int[] Stone;
        public CustomEquipWash Wash;
        public int[][] Equips;
        public int[] suitPlaces;
        public int[] suitLevels;
        public int[] placeStars;
    }
    public struct CustomEquipWash
    {
        public int LV;
        public int[] Value;
    }
    public struct ItemViewInfo
    {
        public int itemId;
        public bool compare;
        public bool unfoldGetWay;
        public bool isAuctionEquip;
        public LegendProperty legendProperty;
        public int score;
    }
    // static PackModel packModel { get { return ModelCenter.Instance.GetModel<PackModel>(); } }
    // static EquipModel equipModel { get { return ModelCenter.Instance.GetModel<EquipModel>(); } }
    // static EquipStarModel starModel { get { return ModelCenter.Instance.GetModel<EquipStarModel>(); } }
    // static EquipGemModel gemModel { get { return ModelCenter.Instance.GetModel<EquipGemModel>(); } }
    // static EquipTrainModel trainModel { get { return ModelCenter.Instance.GetModel<EquipTrainModel>(); } }
    // static EquipStrengthModel strengthenModel { get { return ModelCenter.Instance.GetModel<EquipStrengthModel>(); } }
    // static MountModel mountModel { get { return ModelCenter.Instance.GetModel<MountModel>(); } }
    // static PetModel petModel { get { return ModelCenter.Instance.GetModel<PetModel>(); } }
    // static ComposeWinModel composeModel { get { return ModelCenter.Instance.GetModel<ComposeWinModel>(); } }
    // static StoreModel storeModel { get { return ModelCenter.Instance.GetModel<StoreModel>(); } }
    // static VirtualPackModel virtualPackModel { get { return ModelCenter.Instance.GetModel<VirtualPackModel>(); } }
    // static ItemOverdueModel itemOverdueModel { get { return ModelCenter.Instance.GetModel<ItemOverdueModel>(); } }
    // static BoxGetItemModel boxGetItemModel { get { return ModelCenter.Instance.GetModel<BoxGetItemModel>(); } }
    public static TipData mainTipData { get; private set; }
    public static TipData secondaryData { get; private set; }
    public static void Show(int itemId)
    {
        if (!ItemConfig.HasKey(itemId))
        {
            Item,
            Equip,
            Dogz,
            GatherSoul, //废弃
            KingTreasure, //王者法宝tip
            PetMount,
            SpiritWeapon,
            PeerlessChest,
            TreasureShow, //其他法宝tip
            BoxItem,    //宝箱物品
            TreasurePavilion, //古宝物品(碎片)
            Debug.LogErrorFormat("查无此物品:{0}", itemId);
            return;
        }
        public class TipData
        Show(new ItemViewInfo()
        {
            public string guid;
            public int itemId;
            public int goodId;
            public int exchangeItemId;
            itemId = itemId,
        });
    }
            public BaseInfo baseInfo;
            public BaseProperty baseProperty;
            public BaseProperty petMountBaseProperty;
            public SpiritWeaponProperty spiritWeaponProperty;
            public ShenProperty shenProperty;
            public LegendProperty legendProperty;
            public SkillInfo skillInfo;
            public SuitInfo suitInfo;
            public StarInfo starInfo;
            public StrengthenProperty strengthenProperty;
            public GemInfo gemInfo;
            public TrainProperty trainProperty;
            public List<ItemOperateType> operates;
            public WingRefineMaterials refineMaterials;
            public GetWay getWay;
    public static void Show(ItemViewInfo item)
    {
        var itemId = item.itemId;
        if (!ItemConfig.HasKey(itemId))
        {
            Debug.LogErrorFormat("查无此物品:{0}", itemId);
            return;
        }
        public struct BaseInfo
        {
            public int itemId;
            public int count;
            public bool isAuction;
            public bool isEquiped;
            public bool isPreview;
        // secondaryData = null;
            public int star;
            public int strengthenLevel;
            public int score;
            public bool isOverdue;
            public int auctionSurplusTime;
            public int overdueSurplusTime;
            public int levelLimit;
            public int realmLimit;
            public int moneyLimit;
            public int evolveLevel;
        // var config = ItemConfig.Get(itemId);
        // PrintItemBrief(itemId);
        // var tipType = GetTipType(itemId);
        // switch (tipType)
        // {
        //     case TipType.Equip:
        //         mainTipData = CreateNormalEquipData(itemId);
        //         if (item.isAuctionEquip && !item.legendProperty.Equals(default(LegendProperty)))
        //         {
        //             mainTipData.legendProperty = item.legendProperty;
        //             mainTipData.baseInfo.score = item.score;
        //             mainTipData.baseInfo.isPreview = false;
        //         }
        //         if (item.compare)
        //         {
        //             if (ItemLogicUtility.Instance.IsJobCompatibleItem(itemId))
        //             {
        //                 var equipedGuid = equipModel.GetEquip(new Int2(config.LV, config.EquipPlace));
        //                 if (equipedGuid != string.Empty)
        //                 {
        //                     secondaryData = CreateNormalEquipData(equipedGuid, false);
        //                 }
        //             }
        //         }
        //         break;
        //     case TipType.Dogz:
        //         mainTipData = CreateDogzEquipData(itemId);
        //         break;
        //     case TipType.PeerlessChest:
        //         mainTipData = CreateItemData(itemId);
        //         mainTipData.getWay = default(GetWay);
        //         Dictionary<int, int> selectItems;
        //         if (boxGetItemModel.IsSelectItemByID(itemId, out selectItems))
        //         {
        //             secondaryData = CreateNormalEquipData(selectItems.Keys.First());
        //             secondaryData.getWay = default(GetWay);
        //         }
        //         break;
        //     default:
        //         mainTipData = CreateItemData(itemId);
        //         break;
        // }
        // mainTipData.getWay.defaultUnfold = item.unfoldGetWay;
        // switch (tipType)
        // {
        //     case TipType.Equip:
        //         WindowCenter.Instance.Open<EquipTipWin>();
        //         break;
        //     case TipType.Dogz:
        //         WindowCenter.Instance.Open<EquipTipWin>();
        //         break;
        //     case TipType.KingTreasure:
        //         var kingTreasureShow = ModelCenter.Instance.GetModel<KingTreasureShowModel>();
        //         kingTreasureShow.SetInitData(itemId);
        //         break;
        //     case TipType.PetMount:
        //         WindowCenter.Instance.Open<PetMountTipWin>();
        //         break;
        //     case TipType.SpiritWeapon:
        //         WindowCenter.Instance.Open<SpiritWeaponTipWin>();
        //         break;
        //     case TipType.PeerlessChest:
        //         WindowCenter.Instance.Open<PeerlessChestTipWin>();
        //         break;
        //     case TipType.TreasureShow:
        //         TreasureEffectModel effectModel = ModelCenter.Instance.GetModel<TreasureEffectModel>();
        //         if (config.Effect1 == 232)
        //         {
        //             effectModel.SetTreasureID(config.EffectValueA1, 0);
        //         }
        //         break;
        //     case TipType.BoxItem:
        //         if (WindowCenter.Instance.IsOpen<ItemBoxTipWin>())
        //         {
        //             WindowCenter.Instance.Open<ItemTipWin>();
        //         }
        //         else
        //         {
        //             WindowCenter.Instance.Open<ItemBoxTipWin>();
        //         }
        //         break;
        //     case TipType.TreasurePavilion:
        //         TreasurePavilionModel.Instance.selectGubao = config.EffectValueA1;
        //         TreasurePavilionModel.Instance.showTipFromPiece = config.ID;
        //         WindowCenter.Instance.OpenIL<TreasurePavilionTipWin>();
        //         break;
        //     default:
        //         WindowCenter.Instance.Open<ItemTipWin>();
        //         break;
        // }
    }
    public static void Show(string guid, bool operatable = true)
    {
        var item = PackManager.Instance.GetItemByGuid(guid);
        if (item == null)
        {
            return;
        }
        PrintItemBrief(item.itemId, item);
        secondaryData = null;
        var tipType = GetTipType(item.itemId);
        switch (tipType)
        {
            case TipType.Equip:
                var packType = item.packType;
                switch (packType)
                {
                    case PackType.Equip:
                        // mainTipData = CreateNormalEquipData(guid, operatable);
                        break;
                    default:
                        // if (item.isAuction)
                        // {
                        //     mainTipData = CreateEquipAuctionData(guid, operatable);
                        //     if (ItemLogicUtility.Instance.IsJobCompatibleItem(item.itemId))
                        //     {
                        //         var equipedGuid = equipModel.GetEquip(new Int2(item.config.LV, item.config.EquipPlace));
                        //         if (equipedGuid != string.Empty)
                        //         {
                        //             secondaryData = CreateNormalEquipData(equipedGuid, false);
                        //         }
                        //     }
                        // }
                        // else
                        // {
                        //     mainTipData = CreateNormalEquipData(guid, operatable);
                        //     var equipedGuid = equipModel.GetEquip(new Int2(item.config.LV, item.config.EquipPlace));
                        //     if (equipedGuid != guid)
                        //     {
                        //         secondaryData = CreateNormalEquipData(equipedGuid, false);
                        //     }
                        // }
                        break;
                }
                break;
            default:
                mainTipData = CreateItemData(guid, operatable);
                break;
        }
        public struct BaseProperty
        switch (tipType)
        {
            public List<Int2> baseProperties;
            public int star;
            public List<Int2> starProperties;
            // case TipType.Equip:
            //     WindowCenter.Instance.Open<EquipTipWin>();
            //     break;
            // case TipType.PetMount:
            //     WindowCenter.Instance.Open<PetMountTipWin>();
            //     break;
            // case TipType.BoxItem:
            //     if (WindowCenter.Instance.IsOpen<ItemBoxTipWin>())
            //     {
            //         WindowCenter.Instance.Open<ItemTipWin>();
            //     }
            //     else
            //     {
            //         WindowCenter.Instance.Open<ItemBoxTipWin>();
            //     }
            //     break;
            // case TipType.TreasurePavilion:
            //     TreasurePavilionModel.Instance.selectGubao = item.config.EffectValueA1;
            //     TreasurePavilionModel.Instance.showTipFromPiece = item.itemId;
            //     WindowCenter.Instance.OpenIL<TreasurePavilionTipWin>();
            //     break;
            default:
                UIManager.Instance.OpenWindow<ItemTipWin>();
                break;
        }
        public struct SpiritWeaponProperty
    }
    public static void ShowGood(int goodId, int itemId)
    {
        secondaryData = null;
        var isEquip = ItemLogicUtility.Instance.IsRealmEquip(itemId);
        if (isEquip)
        {
            public int itemId;
            public List<Int3> properties;
            mainTipData = CreateGoodEquipData(itemId, goodId);
        }
        else
        {
            mainTipData = CreateGoodItemData(itemId, goodId);
        }
        public struct LegendProperty
        BuyItemController.Instance.SetGood(goodId);
        var itemConfig = ItemConfig.Get(itemId);
        if (isEquip)
        {
            public bool isPreview;
            public int itemId;
            public int trueCount;
            public List<Int2> properties;
            public int score;
            // WindowCenter.Instance.Open<EquipTipWin>();
        }
        //神装属性
        public struct ShenProperty
        else
        {
            public bool isPreview;
            public int itemId;
            public List<Int3> properties;
        }
            var tipType = GetTipType(itemId);
        public struct SuitInfo
        {
            public int job;
            public string name;
            public int level;
            public int maxSuitLevel;
            public List<int> places;
            public Dictionary<int, int> placeStars;
           // public Dictionary<int, EquipSuitPropertyEntry> twoSuitProperties;
          //  public Dictionary<int, EquipSuitPropertyEntry> fiveSuitProperties;
            public Dictionary<int, bool> eightSuits;
        }
        public struct StarInfo
        {
            public Int2 equipPosition;
            public int starLevel;
            public int maxLevel;
        }
        public struct StrengthenProperty
        {
            public int strengthenLevel;
            public List<Int2> properties;
            public int evolveLevel;
            public int equipPlace;
        }
        public struct GemInfo
        {
            public Dictionary<int, bool> activeStates;
            public Dictionary<int, int> gems;
        }
        public struct TrainProperty
        {
            public int level;
            public List<Int2> properties;
        }
        public struct SkillInfo
        {
            public List<int> skills;
        }
        public struct WingRefineMaterials
        {
            public List<Int2> materials;
        }
        public struct GetWay
        {
            public bool defaultUnfold;
            public int itemId;
            public List<int> ways;
        }
        public struct CustomEquipInfo
        {
            public int job;
            public int itemId;
            public int score;
            public bool isEquiped;
            public List<Int2> legendProperties;
            public List<int> suitPlaces;
            public Dictionary<int, int> placeStars;
           // public Dictionary<EquipSuitType, int> suitLevels;
            public int strengthenLevel;
            public int starLevel;
            public List<Int2> trainProperties;
            public Dictionary<int, bool> gemHoleActiveStates;
            public Dictionary<int, int> gems;
            public List<int> equipSkillList;
            public int evolveLevel;
        }
        public struct CustomItemPlus
        {
            public int ItemID;
            public int count;
            public int Equipped;
            public int Preview;
            public int Star;
            public int PlusLV;
            public int EvolveLV;
            public string UserData;
            public int[] Stone;
            public CustomEquipWash Wash;
            public int[][] Equips;
            public int[] suitPlaces;
            public int[] suitLevels;
            public int[] placeStars;
        }
        public struct CustomEquipWash
        {
            public int LV;
            public int[] Value;
        }
        public struct ItemViewInfo
        {
            public int itemId;
            public bool compare;
            public bool unfoldGetWay;
            public bool isAuctionEquip;
            public LegendProperty legendProperty;
            public int score;
        }
        // static PackModel packModel { get { return ModelCenter.Instance.GetModel<PackModel>(); } }
        // static EquipModel equipModel { get { return ModelCenter.Instance.GetModel<EquipModel>(); } }
        // static EquipStarModel starModel { get { return ModelCenter.Instance.GetModel<EquipStarModel>(); } }
        // static EquipGemModel gemModel { get { return ModelCenter.Instance.GetModel<EquipGemModel>(); } }
        // static EquipTrainModel trainModel { get { return ModelCenter.Instance.GetModel<EquipTrainModel>(); } }
        // static EquipStrengthModel strengthenModel { get { return ModelCenter.Instance.GetModel<EquipStrengthModel>(); } }
        // static MountModel mountModel { get { return ModelCenter.Instance.GetModel<MountModel>(); } }
        // static PetModel petModel { get { return ModelCenter.Instance.GetModel<PetModel>(); } }
        // static ComposeWinModel composeModel { get { return ModelCenter.Instance.GetModel<ComposeWinModel>(); } }
        // static StoreModel storeModel { get { return ModelCenter.Instance.GetModel<StoreModel>(); } }
        // static VirtualPackModel virtualPackModel { get { return ModelCenter.Instance.GetModel<VirtualPackModel>(); } }
        // static ItemOverdueModel itemOverdueModel { get { return ModelCenter.Instance.GetModel<ItemOverdueModel>(); } }
        // static BoxGetItemModel boxGetItemModel { get { return ModelCenter.Instance.GetModel<BoxGetItemModel>(); } }
        public static TipData mainTipData { get; private set; }
        public static TipData secondaryData { get; private set; }
        public static void Show(int itemId)
        {
            if (!ItemConfig.HasKey(itemId))
            {
                Debug.LogErrorFormat("查无此物品:{0}", itemId);
                return;
            }
            Show(new ItemViewInfo()
            {
                itemId = itemId,
            });
        }
        public static void Show(ItemViewInfo item)
        {
            var itemId = item.itemId;
            if (!ItemConfig.HasKey(itemId))
            {
                Debug.LogErrorFormat("查无此物品:{0}", itemId);
                return;
            }
            // secondaryData = null;
            // var config = ItemConfig.Get(itemId);
            // PrintItemBrief(itemId);
            // var tipType = GetTipType(itemId);
            // switch (tipType)
            // {
            //     case TipType.Equip:
            //         mainTipData = CreateNormalEquipData(itemId);
            //         if (item.isAuctionEquip && !item.legendProperty.Equals(default(LegendProperty)))
            //         {
            //             mainTipData.legendProperty = item.legendProperty;
            //             mainTipData.baseInfo.score = item.score;
            //             mainTipData.baseInfo.isPreview = false;
            //         }
            //         if (item.compare)
            //         {
            //             if (ItemLogicUtility.Instance.IsJobCompatibleItem(itemId))
            //             {
            //                 var equipedGuid = equipModel.GetEquip(new Int2(config.LV, config.EquipPlace));
            //                 if (equipedGuid != string.Empty)
            //                 {
            //                     secondaryData = CreateNormalEquipData(equipedGuid, false);
            //                 }
            //             }
            //         }
            //         break;
            //     case TipType.Dogz:
            //         mainTipData = CreateDogzEquipData(itemId);
            //         break;
            //     case TipType.PeerlessChest:
            //         mainTipData = CreateItemData(itemId);
            //         mainTipData.getWay = default(GetWay);
            //         Dictionary<int, int> selectItems;
            //         if (boxGetItemModel.IsSelectItemByID(itemId, out selectItems))
            //         {
            //             secondaryData = CreateNormalEquipData(selectItems.Keys.First());
            //             secondaryData.getWay = default(GetWay);
            //         }
            //         break;
            //     default:
            //         mainTipData = CreateItemData(itemId);
            //         break;
            // }
            // mainTipData.getWay.defaultUnfold = item.unfoldGetWay;
            // switch (tipType)
            // {
            //     case TipType.Equip:
            //         WindowCenter.Instance.Open<EquipTipWin>();
            //         break;
            //     case TipType.Dogz:
            //         WindowCenter.Instance.Open<EquipTipWin>();
            //         break;
            //     case TipType.KingTreasure:
            //         var kingTreasureShow = ModelCenter.Instance.GetModel<KingTreasureShowModel>();
            //         kingTreasureShow.SetInitData(itemId);
            //         break;
            //     case TipType.PetMount:
            //         WindowCenter.Instance.Open<PetMountTipWin>();
            //         break;
            //     case TipType.SpiritWeapon:
            //         WindowCenter.Instance.Open<SpiritWeaponTipWin>();
            //         break;
            //     case TipType.PeerlessChest:
            //         WindowCenter.Instance.Open<PeerlessChestTipWin>();
            //         break;
            //     case TipType.TreasureShow:
            //         TreasureEffectModel effectModel = ModelCenter.Instance.GetModel<TreasureEffectModel>();
            //         if (config.Effect1 == 232)
            //         {
            //             effectModel.SetTreasureID(config.EffectValueA1, 0);
            //         }
            //         break;
            //     case TipType.BoxItem:
            //         if (WindowCenter.Instance.IsOpen<ItemBoxTipWin>())
@@ -333,1679 +464,1534 @@
            //             WindowCenter.Instance.Open<ItemTipWin>();
            //         }
            //         else
            //         {
            //         {
            //             WindowCenter.Instance.Open<ItemBoxTipWin>();
            //         }
            //         break;
            //     case TipType.TreasurePavilion:
            //         TreasurePavilionModel.Instance.selectGubao = config.EffectValueA1;
            //         TreasurePavilionModel.Instance.showTipFromPiece = config.ID;
            //         WindowCenter.Instance.OpenIL<TreasurePavilionTipWin>();
            //         break;
            //     default:
            //         WindowCenter.Instance.Open<ItemTipWin>();
            //         break;
            // }
        }
    }
        // public static void Show(string guid, bool operatable = true)
    // public static void ShowCustomEquip(CustomEquipInfo info)
    // {
    //     secondaryData = null;
    //     mainTipData = CreateCustomEquipData(info);
    //     WindowCenter.Instance.Open<EquipTipWin>();
    // }
    // static TipData CreateNormalEquipData(string guid, bool operatable)
    // {
    //     var item = packModel.GetItemByGuid(guid);
    //     if (item == null)
    //     {
    //         return default(TipData);
    //     }
    //     return new TipData()
    //     {
    //         itemId = item.itemId,
    //         guid = guid,
    //         baseInfo = GetBaseInfo(guid),
    //         baseProperty = GetBaseProperty(guid),
    //         spiritWeaponProperty = GetSpiritWeaponProperty(item.itemId),
    //         legendProperty = GetLegendProperty(guid),
    //         skillInfo = GetSkillInfo(item.itemId, guid),
    //         suitInfo = GetSuitInfo(guid),
    //         starInfo = GetStarInfo(guid),
    //         strengthenProperty = GetStrengthenProperty(guid),
    //         gemInfo = GetGemInfo(guid),
    //         trainProperty = GetTrainProperty(guid),
    //         operates = operatable ? GetOperates(guid) : null,
    //         shenProperty = GetShenProperty(item.itemId)
    //     };
    // }
    // static TipData CreateNormalEquipData(int itemId)
    // {
    //     return new TipData()
    //     {
    //         itemId = itemId,
    //         guid = string.Empty,
    //         baseInfo = GetBaseInfo(itemId),
    //         baseProperty = GetBaseProperty(itemId),
    //         legendProperty = GetLegendProperty(itemId),
    //         spiritWeaponProperty = GetSpiritWeaponProperty(itemId),
    //         skillInfo = GetSkillInfo(itemId),
    //         suitInfo = GetSuitInfo(itemId),
    //         gemInfo = GetGemInfo(itemId),
    //         starInfo = GetStarInfo(itemId),
    //         getWay = GetGetWay(itemId),
    //         shenProperty = GetShenProperty(itemId)
    //     };
    // }
    // static TipData CreateDogzEquipData(string guid)
    // {
    //     var item = packModel.GetItemByGuid(guid);
    //     if (item == null)
    //     {
    //         return default(TipData);
    //     }
    //     return new TipData()
    //     {
    //         itemId = item.itemId,
    //         guid = guid,
    //         baseInfo = GetBaseInfo(guid),
    //         baseProperty = GetBaseProperty(guid),
    //         legendProperty = GetLegendProperty(guid),
    //         operates = GetOperates(guid),
    //     };
    // }
    // static TipData CreateDogzEquipData(int itemId)
    // {
    //     return new TipData()
    //     {
    //         itemId = itemId,
    //         guid = string.Empty,
    //         baseInfo = GetBaseInfo(itemId),
    //         baseProperty = GetBaseProperty(itemId),
    //         legendProperty = GetLegendProperty(itemId),
    //         getWay = GetGetWay(itemId)
    //     };
    // }
    // static TipData CreateCustomEquipData(CustomEquipInfo info)
    // {
    //     var config = ItemConfig.Get(info.itemId);
    //     if (config == null)
    //     {
    //         return default(TipData);
    //     }
    //     var baseInfo = new BaseInfo()
    //     {
    //         itemId = info.itemId,
    //         star = info.starLevel,
    //         strengthenLevel = info.strengthenLevel,
    //         score = info.score,
    //         isEquiped = info.isEquiped,
    //         evolveLevel = info.evolveLevel,
    //     };
    //     var baseProperty = GetBaseProperty(info.itemId);
    //     if (info.starLevel > 0)
    //     {
    //         var starProperties = new List<Int2>();
    //         baseProperty.star = info.starLevel;
    //         var starConfig = EquipStarConfig.Get(config.LV, config.EquipPlace, info.starLevel);
    //         starProperties.AddRange(starConfig.BaseAttrInfo);
    //         baseProperty.starProperties = starProperties;
    //     }
    //     var legendProperty = new LegendProperty()
    //     {
    //         properties = info.legendProperties,
    //     };
    //     var skillInfo = GetSkillInfo(info.itemId, info);
    //     var suitInfo = default(SuitInfo);
    //     if (ItemLogicUtility.Instance.IsSuitEquip(info.itemId))
    //     {
    //         var job = config.JobLimit;
    //         var twoConfigs = EquipSuitConfig.GetConfigs(job, config.LV, EquipSuitType.TwoSuit);
    //         var name = twoConfigs[0].name;
    //         var level = config.LV;
    //         var maxSuitLevel = EquipStarModel.GetMaxStarLevel(level);
    //         var twoSuitProperties = new Dictionary<int, EquipSuitPropertyEntry>();
    //         var fiveSuitProperties = new Dictionary<int, EquipSuitPropertyEntry>();
    //         var eightSuits = new Dictionary<int, bool>();
    //         var eightSuitLevel = info.suitLevels[EquipSuitType.EightSuit];
    //         for (var i = 0; i <= 9; i++, i++, i++)
    //         {
    //             var configs = EquipSuitConfig.GetConfigs(job, level, EquipSuitType.TwoSuit);
    //             var actived = info.suitLevels[EquipSuitType.TwoSuit] >= i;
    //             var properties = new List<Int2>();
    //             foreach (var item in configs)
    //             {
    //                 if (item.star == i)
    //                 {
    //                     properties.AddRange(item.attr);
    //                     break;
    //                 }
    //             }
    //             twoSuitProperties[i] = new EquipSuitPropertyEntry()
    //             {
    //                 type = EquipSuitType.TwoSuit,
    //                 actived = actived,
    //                 properties = properties,
    //             };
    //             configs = EquipSuitConfig.GetConfigs(job, level, EquipSuitType.FiveSuit);
    //             actived = info.suitLevels[EquipSuitType.FiveSuit] >= i;
    //             properties = new List<Int2>();
    //             foreach (var item in configs)
    //             {
    //                 if (item.star == i)
    //                 {
    //                     properties.AddRange(item.attr);
    //                     break;
    //                 }
    //             }
    //             fiveSuitProperties[i] = new EquipSuitPropertyEntry()
    //             {
    //                 type = EquipSuitType.TwoSuit,
    //                 actived = actived,
    //                 properties = properties,
    //             };
    //             eightSuits[i] = eightSuitLevel >= i;
    //         }
    //         suitInfo = new SuitInfo()
    //         {
    //             name = name,
    //             level = level,
    //             job = job,
    //             maxSuitLevel = maxSuitLevel,
    //             places = info.suitPlaces,
    //             placeStars = info.placeStars,
    //             twoSuitProperties = twoSuitProperties,
    //             fiveSuitProperties = fiveSuitProperties,
    //             eightSuits = eightSuits
    //         };
    //     }
    //     var starInfo = new StarInfo()
    //     {
    //         equipPosition = new Int2(config.LV, config.EquipPlace),
    //         starLevel = info.starLevel,
    //         maxLevel = config.LV == 0 ? 0 : EquipStarModel.GetMaxStarLevel(config.ItemColor, config.LV),
    //     };
    //     var type = EquipStrengthModel.GetEquipStrengthType(config.EquipPlace);
    //     var strengthenConfig = ItemPlusConfig.GetTypeAndLevel(type, info.strengthenLevel);
    //     var strengthenProperties = new List<Int2>();
    //     for (int i = 0; i < strengthenConfig.attType.Length; i++)
    //     {
    //         strengthenProperties.Add(new Int2(strengthenConfig.attType[i], strengthenConfig.attValue[i]));
    //     }
    //     var strengthenProperty = new StrengthenProperty()
    //     {
    //         strengthenLevel = info.strengthenLevel,
    //         properties = strengthenProperties,
    //         equipPlace = config.EquipPlace,
    //         evolveLevel = info.evolveLevel,
    //     };
    //     var gemInfo = new GemInfo()
    //     {
    //         activeStates = info.gemHoleActiveStates,
    //         gems = info.gems,
    //     };
    //     var trainProperty = new TrainProperty()
    //     {
    //         properties = info.trainProperties,
    //     };
    //     return new TipData()
    //     {
    //         itemId = info.itemId,
    //         baseInfo = baseInfo,
    //         baseProperty = baseProperty,
    //         legendProperty = legendProperty,
    //         skillInfo = skillInfo,
    //         suitInfo = suitInfo,
    //         starInfo = starInfo,
    //         strengthenProperty = strengthenProperty,
    //         gemInfo = gemInfo,
    //         trainProperty = trainProperty,
    //         shenProperty = GetShenProperty(info.itemId)
    //     };
    // }
    static TipData CreateGoodEquipData(int itemId, int goodId)
    {
        return new TipData()
        {
            itemId = itemId,
            guid = string.Empty,
            goodId = goodId,
            baseInfo = GetBaseInfo(itemId),
            baseProperty = GetBaseProperty(itemId),
            //spiritWeaponProperty = GetSpiritWeaponProperty(itemId),
            //legendProperty = GetLegendProperty(itemId),
            skillInfo = GetSkillInfo(itemId),
            //suitInfo = GetSuitInfo(itemId),
            //gemInfo = GetGemInfo(itemId),
            //starInfo = GetStarInfo(itemId),
            operates = GetGoodOperates(goodId),
            //shenProperty = GetShenProperty(itemId)
        };
    }
    // static TipData CreateEquipAuctionData(string guid, bool operatable)
    // {
    //     var item = packModel.GetItemByGuid(guid);
    //     if (item == null)
    //     {
    //         return default(TipData);
    //     }
    //     var legendProperty = GetLegendProperty(guid);
    //     if (legendProperty.properties.IsNullOrEmpty())
    //     {
    //         legendProperty = GetLegendProperty(item.itemId);
    //     }
    //     return new TipData()
    //     {
    //         itemId = item.itemId,
    //         guid = guid,
    //         baseInfo = GetBaseInfo(guid),
    //         baseProperty = GetBaseProperty(item.itemId),
    //         spiritWeaponProperty = GetSpiritWeaponProperty(item.itemId),
    //         legendProperty = legendProperty,
    //         skillInfo = GetSkillInfo(item.itemId, guid),
    //         suitInfo = GetSuitInfo(item.itemId),
    //         operates = operatable ? GetOperates(guid) : null,
    //         starInfo = GetStarInfo(guid),
    //         gemInfo = GetGemInfo(guid),
    //         shenProperty = GetShenProperty(item.itemId)
    //     };
    // }
    static TipData CreateItemData(string guid, bool operatable)
    {
        var item = PackManager.Instance.GetItemByGuid(guid);
        if (item == null)
        {
            return default(TipData);
        }
        return new TipData()
        {
            itemId = item.itemId,
            guid = guid,
            baseInfo = GetBaseInfo(guid),
            baseProperty = GetBaseProperty(item.itemId),
            // spiritWeaponProperty = GetSpiritWeaponProperty(item.itemId),
            // legendProperty = GetLegendProperty(guid),
            // petMountBaseProperty = GetPetMountBaseProperty(item.itemId),
            // operates = operatable ? GetOperates(guid) : null,
            // refineMaterials = GetWingRefineMaterials(guid),
            // shenProperty = GetShenProperty(item.itemId)
        };
    }
    // static TipData CreateItemData(int itemId)
    // {
    //     return new TipData()
    //     {
    //         itemId = itemId,
    //         baseInfo = GetBaseInfo(itemId),
    //         baseProperty = GetBaseProperty(itemId),
    //         exchangeItemId = itemId,
    //         spiritWeaponProperty = GetSpiritWeaponProperty(itemId),
    //         legendProperty = GetLegendProperty(itemId),
    //         petMountBaseProperty = GetPetMountBaseProperty(itemId),
    //         getWay = GetGetWay(itemId),
    //         shenProperty = GetShenProperty(itemId)
    //     };
    // }
    static TipData CreateGoodItemData(int itemId, int goodId)
    {
        return new TipData()
        {
            itemId = itemId,
            goodId = goodId,
            baseInfo = GetBaseInfo(itemId),
            baseProperty = GetBaseProperty(itemId),
            // legendProperty = GetLegendProperty(itemId),
            // spiritWeaponProperty = GetSpiritWeaponProperty(itemId),
            // petMountBaseProperty = GetPetMountBaseProperty(itemId),
            operates = GetGoodOperates(goodId),
            // shenProperty = GetShenProperty(itemId)
        };
    }
    // public static void Operate(ItemOperateType type, string guid)
    // {
    //     switch (type)
    //     {
    //         case ItemOperateType.putOn:
    //             ItemOperateUtility.Instance.PutOnItem(guid);
    //             break;
    //         case ItemOperateType.gotoPuton:
    //             ItemOperateUtility.Instance.PutOnItem(guid);
    //             break;
    //         case ItemOperateType.putOff:
    //             ItemOperateUtility.Instance.PutOffEquip(guid);
    //             break;
    //         case ItemOperateType.putAway:
    //             ItemOperateUtility.Instance.PutAway(guid);
    //             break;
    //         case ItemOperateType.putIn:
    //             ItemOperateUtility.Instance.PutInWareHouse(guid);
    //             break;
    //         case ItemOperateType.putOut:
    //             ItemOperateUtility.Instance.TakeOutFromWarehouse(guid);
    //             break;
    //         case ItemOperateType.sell:
    //             ItemOperateUtility.Instance.SellItem(guid);
    //             break;
    //         case ItemOperateType.strength:
    //             ItemOperateUtility.Instance.GotoStrengthen(guid);
    //             break;
    //         case ItemOperateType.star:
    //             ItemOperateUtility.Instance.GotoStarUpgrade(guid);
    //             break;
    //         case ItemOperateType.inlay:
    //             ItemOperateUtility.Instance.GotoInlayItem(guid);
    //             break;
    //         case ItemOperateType.train:
    //             ItemOperateUtility.Instance.GotoTrain(guid);
    //             break;
    //         case ItemOperateType.makeUse:
    //             ItemOperateUtility.Instance.GotoUseItem(guid);
    //             break;
    //         case ItemOperateType.split:
    //             ItemOperateUtility.Instance.OnClickSplitBtn(guid);
    //             break;
    //         case ItemOperateType.compose:
    //             var wannaComposeItem = packModel.GetItemByGuid(guid);
    //             var jumpId = 0;
    //             var isUnlock = composeModel.CheckComposeItemById(wannaComposeItem.itemId, out jumpId);
    //             if (isUnlock)
    //             {
    //                 ItemOperateUtility.Instance.GotoComposeItem(jumpId);
    //             }
    //             break;
    //         case ItemOperateType.renewal:
    //             ItemOperateUtility.Instance.RenewalItem(guid);
    //             break;
    //         case ItemOperateType.exchange:
    //             WindowJumpMgr.Instance.WindowJumpTo(JumpUIType.ExchangeActiveToken);
    //             break;
    //         case ItemOperateType.lsExchange:
    //             WindowCenter.Instance.Open<LingShiChange>();
    //             break;
    //         case ItemOperateType.default1:
    //             var item = packModel.GetItemByGuid(guid);
    //             if (item == null)
    //             {
    //                 break;
    //             }
    //             EquipEvolveModel.Instance.EquipJump(item.config.LV, item.config.EquipPlace);
    //             WindowJumpMgr.Instance.WindowJumpTo((JumpUIType)2013);
    //             break;
    //     }
    // }
    // public static void GoodOperate(ItemOperateType type, int goodId, int count)
    // {
    //     var config = StoreConfig.Get(goodId);
    //     storeModel.SendBuyShopItem(config, count);
    // }
    private static BaseInfo GetBaseInfo(int itemId)
    {
        var config = ItemConfig.Get(itemId);
        var money = 0;
        if (config.Type == 81)
        {
            var chestConfig = ChestsConfig.Get(itemId);
            money = chestConfig.OpenMoney;
        }
        var baseInfo = new BaseInfo()
        {
            itemId = itemId,
            isAuction = false,
            isEquiped = false,
            isPreview = true,
            //score = ItemLogicUtility.Instance.GetEquipScore(itemId, null, true),
            auctionSurplusTime = 0,
            levelLimit = config.UseLV,
            moneyLimit = money,
        };
        return baseInfo;
    }
    private static BaseInfo GetBaseInfo(string guid)
    {
        var item = PackManager.Instance.GetItemByGuid(guid);
        var level = item.config.LV;
        var place = item.config.EquipPlace;
        var isEquiped = false;// equipModel.GetEquip(new Int2(level, place)) == guid;
        // var type = EquipStrengthModel.GetEquipStrengthType(place);
        var star = 0; //starModel.GetEquipStarLevel(new Int2(level, place));
        var maxStrengthenLevel = 0; //strengthenModel.GetEquipLevelMax(type, level);
        var placeStrengthenLevel = 0;   //strengthenModel.GetStrengthLevel(level, place);
        var money = 0;
        // if (item.config.Type == 81)
        // {
        //     var item = packModel.GetItemByGuid(guid);
        //     if (item == null)
        //     {
        //         return;
        //     }
        //     PrintItemBrief(item.itemId, guid);
        //     secondaryData = null;
        //     var tipType = GetTipType(item.itemId);
        //     switch (tipType)
        //     {
        //         case TipType.Equip:
        //             var packType = item.packType;
        //             switch (packType)
        //             {
        //                 case PackType.Equip:
        //                     mainTipData = CreateNormalEquipData(guid, operatable);
        //                     break;
        //                 default:
        //                     if (item.isAuction)
        //                     {
        //                         mainTipData = CreateEquipAuctionData(guid, operatable);
        //                         if (ItemLogicUtility.Instance.IsJobCompatibleItem(item.itemId))
        //                         {
        //                             var equipedGuid = equipModel.GetEquip(new Int2(item.config.LV, item.config.EquipPlace));
        //                             if (equipedGuid != string.Empty)
        //                             {
        //                                 secondaryData = CreateNormalEquipData(equipedGuid, false);
        //                             }
        //                         }
        //                     }
        //                     else
        //                     {
        //                         mainTipData = CreateNormalEquipData(guid, operatable);
        //                         var equipedGuid = equipModel.GetEquip(new Int2(item.config.LV, item.config.EquipPlace));
        //                         if (equipedGuid != guid)
        //                         {
        //                             secondaryData = CreateNormalEquipData(equipedGuid, false);
        //                         }
        //                     }
        //                     break;
        //             }
        //             break;
        //         case TipType.Dogz:
        //             mainTipData = CreateDogzEquipData(guid);
        //             break;
        //         default:
        //             mainTipData = CreateItemData(guid, operatable);
        //             break;
        //     }
        //     switch (tipType)
        //     {
        //         case TipType.Equip:
        //             WindowCenter.Instance.Open<EquipTipWin>();
        //             break;
        //         case TipType.Dogz:
        //             WindowCenter.Instance.Open<EquipTipWin>();
        //             break;
        //         case TipType.KingTreasure:
        //             var kingTreasureShow = ModelCenter.Instance.GetModel<KingTreasureShowModel>();
        //             kingTreasureShow.SetInitData(item.itemId);
        //             break;
        //         case TipType.PetMount:
        //             WindowCenter.Instance.Open<PetMountTipWin>();
        //             break;
        //         case TipType.SpiritWeapon:
        //             WindowCenter.Instance.Open<SpiritWeaponTipWin>();
        //             break;
        //         case TipType.BoxItem:
        //             if (WindowCenter.Instance.IsOpen<ItemBoxTipWin>())
        //             {
        //                 WindowCenter.Instance.Open<ItemTipWin>();
        //             }
        //             else
        //             {
        //                 WindowCenter.Instance.Open<ItemBoxTipWin>();
        //             }
        //             break;
        //         case TipType.TreasurePavilion:
        //             TreasurePavilionModel.Instance.selectGubao = item.config.EffectValueA1;
        //             TreasurePavilionModel.Instance.showTipFromPiece = item.itemId;
        //             WindowCenter.Instance.OpenIL<TreasurePavilionTipWin>();
        //             break;
        //         default:
        //             WindowCenter.Instance.Open<ItemTipWin>();
        //             break;
        //     }
        //     var chestConfig = ChestsConfig.Get(item.itemId);
        //     money = chestConfig.OpenMoney;
        // }
        public static void ShowGood(int goodId, int itemId)
        var baseInfo = new BaseInfo()
        {
            secondaryData = null;
            itemId = item.itemId,
            count = item.count,
            isAuction = item.isAuction,
            isEquiped = isEquiped,
            isPreview = false,
            score = item.score,
            isOverdue = ItemLogicUtility.Instance.IsOverdue(guid),
            auctionSurplusTime = item.isAuction ? item.auctionSurplusTime : 0,
            overdueSurplusTime = item.overdueSurplusTime,
            levelLimit = item.isAuction ? 0 : item.config.UseLV,
            star = isEquiped ? star : -1,
            strengthenLevel = isEquiped ? Mathf.Min(placeStrengthenLevel, maxStrengthenLevel) : 0,
            moneyLimit = money,
        };
            var isEquip = ItemLogicUtility.Instance.IsRealmEquip(itemId);
            if (isEquip)
            {
                mainTipData = CreateGoodEquipData(itemId, goodId);
            }
            else
            {
                mainTipData = CreateGoodItemData(itemId, goodId);
            }
        return baseInfo;
    }
            BuyItemController.Instance.SetGood(goodId);
            var itemConfig = ItemConfig.Get(itemId);
            if (isEquip)
            {
                // WindowCenter.Instance.Open<EquipTipWin>();
            }
            else
            {
                var tipType = GetTipType(itemId);
    private static BaseProperty GetBaseProperty(int itemId)
    {
        var baseProperties = new List<Int2>();
        var config = ItemConfig.Get(itemId);
                // switch (tipType)
                // {
                //     case TipType.PetMount:
                //         WindowCenter.Instance.Open<PetMountTipWin>();
                //         break;
                //     case TipType.BoxItem:
                //         if (WindowCenter.Instance.IsOpen<ItemBoxTipWin>())
                //         {
                //             WindowCenter.Instance.Open<ItemTipWin>();
                //         }
                //         else
                //         {
                //             WindowCenter.Instance.Open<ItemBoxTipWin>();
                //         }
                //         break;
                //     default:
                //         WindowCenter.Instance.Open<ItemTipWin>();
                //         break;
                // }
        if (config.Effect1 == 220)
        {
            return GetBaseProperty(config.EffectValueA1);
        }
        if (!ItemLogicUtility.Instance.IsDogzEquip(itemId))
        {
            if (config.Effect1 != 0)
            {
                baseProperties.Add(new Int2(config.Effect1, config.EffectValueA1));
            }
        }
        // public static void ShowCustomEquip(CustomEquipInfo info)
        // {
        //     secondaryData = null;
        //     mainTipData = CreateCustomEquipData(info);
        //     WindowCenter.Instance.Open<EquipTipWin>();
        // }
        // static TipData CreateNormalEquipData(string guid, bool operatable)
        // {
        //     var item = packModel.GetItemByGuid(guid);
        //     if (item == null)
        //     {
        //         return default(TipData);
        //     }
        //     return new TipData()
        //     {
        //         itemId = item.itemId,
        //         guid = guid,
        //         baseInfo = GetBaseInfo(guid),
        //         baseProperty = GetBaseProperty(guid),
        //         spiritWeaponProperty = GetSpiritWeaponProperty(item.itemId),
        //         legendProperty = GetLegendProperty(guid),
        //         skillInfo = GetSkillInfo(item.itemId, guid),
        //         suitInfo = GetSuitInfo(guid),
        //         starInfo = GetStarInfo(guid),
        //         strengthenProperty = GetStrengthenProperty(guid),
        //         gemInfo = GetGemInfo(guid),
        //         trainProperty = GetTrainProperty(guid),
        //         operates = operatable ? GetOperates(guid) : null,
        //         shenProperty = GetShenProperty(item.itemId)
        //     };
        // }
        // static TipData CreateNormalEquipData(int itemId)
        // {
        //     return new TipData()
        //     {
        //         itemId = itemId,
        //         guid = string.Empty,
        //         baseInfo = GetBaseInfo(itemId),
        //         baseProperty = GetBaseProperty(itemId),
        //         legendProperty = GetLegendProperty(itemId),
        //         spiritWeaponProperty = GetSpiritWeaponProperty(itemId),
        //         skillInfo = GetSkillInfo(itemId),
        //         suitInfo = GetSuitInfo(itemId),
        //         gemInfo = GetGemInfo(itemId),
        //         starInfo = GetStarInfo(itemId),
        //         getWay = GetGetWay(itemId),
        //         shenProperty = GetShenProperty(itemId)
        //     };
        // }
        // static TipData CreateDogzEquipData(string guid)
        // {
        //     var item = packModel.GetItemByGuid(guid);
        //     if (item == null)
        //     {
        //         return default(TipData);
        //     }
        //     return new TipData()
        //     {
        //         itemId = item.itemId,
        //         guid = guid,
        //         baseInfo = GetBaseInfo(guid),
        //         baseProperty = GetBaseProperty(guid),
        //         legendProperty = GetLegendProperty(guid),
        //         operates = GetOperates(guid),
        //     };
        // }
        // static TipData CreateDogzEquipData(int itemId)
        // {
        //     return new TipData()
        //     {
        //         itemId = itemId,
        //         guid = string.Empty,
        //         baseInfo = GetBaseInfo(itemId),
        //         baseProperty = GetBaseProperty(itemId),
        //         legendProperty = GetLegendProperty(itemId),
        //         getWay = GetGetWay(itemId)
        //     };
        // }
        // static TipData CreateCustomEquipData(CustomEquipInfo info)
        // {
        //     var config = ItemConfig.Get(info.itemId);
        //     if (config == null)
        //     {
        //         return default(TipData);
        //     }
        //     var baseInfo = new BaseInfo()
        //     {
        //         itemId = info.itemId,
        //         star = info.starLevel,
        //         strengthenLevel = info.strengthenLevel,
        //         score = info.score,
        //         isEquiped = info.isEquiped,
        //         evolveLevel = info.evolveLevel,
        //     };
        //     var baseProperty = GetBaseProperty(info.itemId);
        //     if (info.starLevel > 0)
        //     {
        //         var starProperties = new List<Int2>();
        //         baseProperty.star = info.starLevel;
        //         var starConfig = EquipStarConfig.Get(config.LV, config.EquipPlace, info.starLevel);
        //         starProperties.AddRange(starConfig.BaseAttrInfo);
        //         baseProperty.starProperties = starProperties;
        //     }
        //     var legendProperty = new LegendProperty()
        //     {
        //         properties = info.legendProperties,
        //     };
        //     var skillInfo = GetSkillInfo(info.itemId, info);
        //     var suitInfo = default(SuitInfo);
        //     if (ItemLogicUtility.Instance.IsSuitEquip(info.itemId))
        //     {
        //         var job = config.JobLimit;
        //         var twoConfigs = EquipSuitConfig.GetConfigs(job, config.LV, EquipSuitType.TwoSuit);
        //         var name = twoConfigs[0].name;
        //         var level = config.LV;
        //         var maxSuitLevel = EquipStarModel.GetMaxStarLevel(level);
        //         var twoSuitProperties = new Dictionary<int, EquipSuitPropertyEntry>();
        //         var fiveSuitProperties = new Dictionary<int, EquipSuitPropertyEntry>();
        //         var eightSuits = new Dictionary<int, bool>();
        //         var eightSuitLevel = info.suitLevels[EquipSuitType.EightSuit];
        //         for (var i = 0; i <= 9; i++, i++, i++)
        //         {
        //             var configs = EquipSuitConfig.GetConfigs(job, level, EquipSuitType.TwoSuit);
        //             var actived = info.suitLevels[EquipSuitType.TwoSuit] >= i;
        //             var properties = new List<Int2>();
        //             foreach (var item in configs)
        //             {
        //                 if (item.star == i)
        //                 {
        //                     properties.AddRange(item.attr);
        //                     break;
        //                 }
        //             }
        //             twoSuitProperties[i] = new EquipSuitPropertyEntry()
        //             {
        //                 type = EquipSuitType.TwoSuit,
        //                 actived = actived,
        //                 properties = properties,
        //             };
        //             configs = EquipSuitConfig.GetConfigs(job, level, EquipSuitType.FiveSuit);
        //             actived = info.suitLevels[EquipSuitType.FiveSuit] >= i;
        //             properties = new List<Int2>();
        //             foreach (var item in configs)
        //             {
        //                 if (item.star == i)
        //                 {
        //                     properties.AddRange(item.attr);
        //                     break;
        //                 }
        //             }
        //             fiveSuitProperties[i] = new EquipSuitPropertyEntry()
        //             {
        //                 type = EquipSuitType.TwoSuit,
        //                 actived = actived,
        //                 properties = properties,
        //             };
        //             eightSuits[i] = eightSuitLevel >= i;
        //         }
        //         suitInfo = new SuitInfo()
        //         {
        //             name = name,
        //             level = level,
        //             job = job,
        //             maxSuitLevel = maxSuitLevel,
        //             places = info.suitPlaces,
        //             placeStars = info.placeStars,
        //             twoSuitProperties = twoSuitProperties,
        //             fiveSuitProperties = fiveSuitProperties,
        //             eightSuits = eightSuits
        //         };
        //     }
        //     var starInfo = new StarInfo()
        //     {
        //         equipPosition = new Int2(config.LV, config.EquipPlace),
        //         starLevel = info.starLevel,
        //         maxLevel = config.LV == 0 ? 0 : EquipStarModel.GetMaxStarLevel(config.ItemColor, config.LV),
        //     };
        //     var type = EquipStrengthModel.GetEquipStrengthType(config.EquipPlace);
        //     var strengthenConfig = ItemPlusConfig.GetTypeAndLevel(type, info.strengthenLevel);
        //     var strengthenProperties = new List<Int2>();
        //     for (int i = 0; i < strengthenConfig.attType.Length; i++)
        //     {
        //         strengthenProperties.Add(new Int2(strengthenConfig.attType[i], strengthenConfig.attValue[i]));
        //     }
        //     var strengthenProperty = new StrengthenProperty()
        //     {
        //         strengthenLevel = info.strengthenLevel,
        //         properties = strengthenProperties,
        //         equipPlace = config.EquipPlace,
        //         evolveLevel = info.evolveLevel,
        //     };
        //     var gemInfo = new GemInfo()
        //     {
        //         activeStates = info.gemHoleActiveStates,
        //         gems = info.gems,
        //     };
        //     var trainProperty = new TrainProperty()
        //     {
        //         properties = info.trainProperties,
        //     };
        //     return new TipData()
        //     {
        //         itemId = info.itemId,
        //         baseInfo = baseInfo,
        //         baseProperty = baseProperty,
        //         legendProperty = legendProperty,
        //         skillInfo = skillInfo,
        //         suitInfo = suitInfo,
        //         starInfo = starInfo,
        //         strengthenProperty = strengthenProperty,
        //         gemInfo = gemInfo,
        //         trainProperty = trainProperty,
        //         shenProperty = GetShenProperty(info.itemId)
        //     };
        // }
        static TipData CreateGoodEquipData(int itemId, int goodId)
        if (config.Effect2 != 0)
        {
            return new TipData()
            {
                itemId = itemId,
                guid = string.Empty,
                goodId = goodId,
                baseInfo = GetBaseInfo(itemId),
                baseProperty = GetBaseProperty(itemId),
                //spiritWeaponProperty = GetSpiritWeaponProperty(itemId),
                //legendProperty = GetLegendProperty(itemId),
                skillInfo = GetSkillInfo(itemId),
                //suitInfo = GetSuitInfo(itemId),
                //gemInfo = GetGemInfo(itemId),
                //starInfo = GetStarInfo(itemId),
                operates = GetGoodOperates(goodId),
                //shenProperty = GetShenProperty(itemId)
            };
            baseProperties.Add(new Int2(config.Effect2, config.EffectValueA2));
        }
        // static TipData CreateEquipAuctionData(string guid, bool operatable)
        // {
        //     var item = packModel.GetItemByGuid(guid);
        //     if (item == null)
        //     {
        //         return default(TipData);
        //     }
        //     var legendProperty = GetLegendProperty(guid);
        //     if (legendProperty.properties.IsNullOrEmpty())
        //     {
        //         legendProperty = GetLegendProperty(item.itemId);
        //     }
        //     return new TipData()
        //     {
        //         itemId = item.itemId,
        //         guid = guid,
        //         baseInfo = GetBaseInfo(guid),
        //         baseProperty = GetBaseProperty(item.itemId),
        //         spiritWeaponProperty = GetSpiritWeaponProperty(item.itemId),
        //         legendProperty = legendProperty,
        //         skillInfo = GetSkillInfo(item.itemId, guid),
        //         suitInfo = GetSuitInfo(item.itemId),
        //         operates = operatable ? GetOperates(guid) : null,
        //         starInfo = GetStarInfo(guid),
        //         gemInfo = GetGemInfo(guid),
        //         shenProperty = GetShenProperty(item.itemId)
        //     };
        // }
        // static TipData CreateItemData(string guid, bool operatable)
        // {
        //     var item = packModel.GetItemByGuid(guid);
        //     if (item == null)
        //     {
        //         return default(TipData);
        //     }
        //     return new TipData()
        //     {
        //         itemId = item.itemId,
        //         guid = guid,
        //         baseInfo = GetBaseInfo(guid),
        //         baseProperty = GetBaseProperty(item.itemId),
        //         spiritWeaponProperty = GetSpiritWeaponProperty(item.itemId),
        //         legendProperty = GetLegendProperty(guid),
        //         petMountBaseProperty = GetPetMountBaseProperty(item.itemId),
        //         operates = operatable ? GetOperates(guid) : null,
        //         refineMaterials = GetWingRefineMaterials(guid),
        //         shenProperty = GetShenProperty(item.itemId)
        //     };
        // }
        // static TipData CreateItemData(int itemId)
        // {
        //     return new TipData()
        //     {
        //         itemId = itemId,
        //         baseInfo = GetBaseInfo(itemId),
        //         baseProperty = GetBaseProperty(itemId),
        //         exchangeItemId = itemId,
        //         spiritWeaponProperty = GetSpiritWeaponProperty(itemId),
        //         legendProperty = GetLegendProperty(itemId),
        //         petMountBaseProperty = GetPetMountBaseProperty(itemId),
        //         getWay = GetGetWay(itemId),
        //         shenProperty = GetShenProperty(itemId)
        //     };
        // }
        static TipData CreateGoodItemData(int itemId, int goodId)
        if (config.Effect3 != 0)
        {
            return new TipData()
            {
                itemId = itemId,
                goodId = goodId,
                baseInfo = GetBaseInfo(itemId),
                baseProperty = GetBaseProperty(itemId),
                // legendProperty = GetLegendProperty(itemId),
                // spiritWeaponProperty = GetSpiritWeaponProperty(itemId),
                // petMountBaseProperty = GetPetMountBaseProperty(itemId),
                operates = GetGoodOperates(goodId),
                // shenProperty = GetShenProperty(itemId)
            };
            baseProperties.Add(new Int2(config.Effect3, config.EffectValueA3));
        }
        // public static void Operate(ItemOperateType type, string guid)
        // {
        //     switch (type)
        //     {
        //         case ItemOperateType.putOn:
        //             ItemOperateUtility.Instance.PutOnItem(guid);
        //             break;
        //         case ItemOperateType.gotoPuton:
        //             ItemOperateUtility.Instance.PutOnItem(guid);
        //             break;
        //         case ItemOperateType.putOff:
        //             ItemOperateUtility.Instance.PutOffEquip(guid);
        //             break;
        //         case ItemOperateType.putAway:
        //             ItemOperateUtility.Instance.PutAway(guid);
        //             break;
        //         case ItemOperateType.putIn:
        //             ItemOperateUtility.Instance.PutInWareHouse(guid);
        //             break;
        //         case ItemOperateType.putOut:
        //             ItemOperateUtility.Instance.TakeOutFromWarehouse(guid);
        //             break;
        //         case ItemOperateType.sell:
        //             ItemOperateUtility.Instance.SellItem(guid);
        //             break;
        //         case ItemOperateType.strength:
        //             ItemOperateUtility.Instance.GotoStrengthen(guid);
        //             break;
        //         case ItemOperateType.star:
        //             ItemOperateUtility.Instance.GotoStarUpgrade(guid);
        //             break;
        //         case ItemOperateType.inlay:
        //             ItemOperateUtility.Instance.GotoInlayItem(guid);
        //             break;
        //         case ItemOperateType.train:
        //             ItemOperateUtility.Instance.GotoTrain(guid);
        //             break;
        //         case ItemOperateType.makeUse:
        //             ItemOperateUtility.Instance.GotoUseItem(guid);
        //             break;
        //         case ItemOperateType.split:
        //             ItemOperateUtility.Instance.OnClickSplitBtn(guid);
        //             break;
        //         case ItemOperateType.compose:
        //             var wannaComposeItem = packModel.GetItemByGuid(guid);
        //             var jumpId = 0;
        //             var isUnlock = composeModel.CheckComposeItemById(wannaComposeItem.itemId, out jumpId);
        //             if (isUnlock)
        //             {
        //                 ItemOperateUtility.Instance.GotoComposeItem(jumpId);
        //             }
        //             break;
        //         case ItemOperateType.renewal:
        //             ItemOperateUtility.Instance.RenewalItem(guid);
        //             break;
        //         case ItemOperateType.exchange:
        //             WindowJumpMgr.Instance.WindowJumpTo(JumpUIType.ExchangeActiveToken);
        //             break;
        //         case ItemOperateType.lsExchange:
        //             WindowCenter.Instance.Open<LingShiChange>();
        //             break;
        //         case ItemOperateType.default1:
        //             var item = packModel.GetItemByGuid(guid);
        //             if (item == null)
        //             {
        //                 break;
        //             }
        //             EquipEvolveModel.Instance.EquipJump(item.config.LV, item.config.EquipPlace);
        //             WindowJumpMgr.Instance.WindowJumpTo((JumpUIType)2013);
        //             break;
        //     }
        // }
        // public static void GoodOperate(ItemOperateType type, int goodId, int count)
        // {
        //     var config = StoreConfig.Get(goodId);
        //     storeModel.SendBuyShopItem(config, count);
        // }
        private static BaseInfo GetBaseInfo(int itemId)
        if (config.Effect4 != 0)
        {
            var config = ItemConfig.Get(itemId);
            var money = 0;
            if (config.Type == 81)
            {
                var chestConfig = ChestsConfig.Get(itemId);
                money = chestConfig.OpenMoney;
            }
            var baseInfo = new BaseInfo()
            {
                itemId = itemId,
                isAuction = false,
                isEquiped = false,
                isPreview = true,
                //score = ItemLogicUtility.Instance.GetEquipScore(itemId, null, true),
                auctionSurplusTime = 0,
                levelLimit = config.UseLV,
                realmLimit = config.RealmLimit,
                moneyLimit = money,
            };
            return baseInfo;
            baseProperties.Add(new Int2(config.Effect4, config.EffectValueA4));
        }
        // private static BaseInfo GetBaseInfo(string guid)
        // {
        //     var item = packModel.GetItemByGuid(guid);
        //     var level = item.config.LV;
        //     var place = item.config.EquipPlace;
        //     var isEquiped = equipModel.GetEquip(new Int2(level, place)) == guid;
        //     var type = EquipStrengthModel.GetEquipStrengthType(place);
        //     var star = starModel.GetEquipStarLevel(new Int2(level, place));
        //     var maxStrengthenLevel = strengthenModel.GetEquipLevelMax(type, level);
        //     var placeStrengthenLevel = strengthenModel.GetStrengthLevel(level, place);
        //     var money = 0;
        //     if (item.config.Type == 81)
        //     {
        //         var chestConfig = ChestsConfig.Get(item.itemId);
        //         money = chestConfig.OpenMoney;
        //     }
        //     var baseInfo = new BaseInfo()
        //     {
        //         itemId = item.itemId,
        //         count = item.count,
        //         isAuction = item.isAuction,
        //         isEquiped = isEquiped,
        //         isPreview = false,
        //         score = item.score,
        //         isOverdue = ItemLogicUtility.Instance.IsOverdue(guid),
        //         auctionSurplusTime = item.isAuction ? item.auctionSurplusTime : 0,
        //         overdueSurplusTime = item.overdueSurplusTime,
        //         levelLimit = item.isAuction ? 0 : item.config.UseLV,
        //         realmLimit = item.isAuction ? 0 : item.config.RealmLimit,
        //         star = isEquiped ? star : -1,
        //         strengthenLevel = isEquiped ? Mathf.Min(placeStrengthenLevel, maxStrengthenLevel) : 0,
        //         moneyLimit = money,
        //     };
        //     return baseInfo;
        // }
        private static BaseProperty GetBaseProperty(int itemId)
        if (config.Effect5 != 0)
        {
            var baseProperties = new List<Int2>();
            var config = ItemConfig.Get(itemId);
            if (config.Effect1 == 220)
            {
                return GetBaseProperty(config.EffectValueA1);
            }
            if (!ItemLogicUtility.Instance.IsDogzEquip(itemId))
            {
                if (config.Effect1 != 0)
                {
                    baseProperties.Add(new Int2(config.Effect1, config.EffectValueA1));
                }
            }
            if (config.Effect2 != 0)
            {
                baseProperties.Add(new Int2(config.Effect2, config.EffectValueA2));
            }
            if (config.Effect3 != 0)
            {
                baseProperties.Add(new Int2(config.Effect3, config.EffectValueA3));
            }
            if (config.Effect4 != 0)
            {
                baseProperties.Add(new Int2(config.Effect4, config.EffectValueA4));
            }
            if (config.Effect5 != 0)
            {
                baseProperties.Add(new Int2(config.Effect5, config.EffectValueA5));
            }
            var baseProperty = new BaseProperty()
            {
                baseProperties = baseProperties,
            };
            return baseProperty;
            baseProperties.Add(new Int2(config.Effect5, config.EffectValueA5));
        }
        private static BaseProperty GetBaseProperty(string guid)
        var baseProperty = new BaseProperty()
        {
            var item = PackManager.Instance.GetItemByGuid(guid);
            var equipPosition = new Int2(item.config.LV, item.config.EquipPlace);
            var equiped = true;//equipModel.GetEquip(equipPosition) == guid;
            baseProperties = baseProperties,
        };
            var baseProperty = GetBaseProperty(item.itemId);
        return baseProperty;
    }
            if (equiped)
            {
                var starProperties = new List<Int2>();
                // var currentStar = starModel.GetEquipStarLevel(equipPosition);
                // var maxStar = EquipStarModel.GetMaxStarLevel(item.config.ItemColor, item.config.LV);
                // var star = Mathf.Min(currentStar, maxStar);
                // if (star > 0)
                // {
                //     baseProperty.star = star;
                //     var starConfig = EquipStarConfig.Get(item.config.LV, item.config.EquipPlace, star);
                //     starProperties.AddRange(starConfig.BaseAttrInfo);
                // }
    private static BaseProperty GetBaseProperty(string guid)
    {
        var item = PackManager.Instance.GetItemByGuid(guid);
        var equipPosition = new Int2(item.config.LV, item.config.EquipPlace);
        var equiped = true;//equipModel.GetEquip(equipPosition) == guid;
                baseProperty.starProperties = starProperties;
            }
        var baseProperty = GetBaseProperty(item.itemId);
            return baseProperty;
        }
        // private static BaseProperty GetPetMountBaseProperty(int itemId)
        // {
        //     var config = ItemConfig.Get(itemId);
        //     var baseProperty = new BaseProperty();
        //     Dictionary<int, int> properties = null;
        //     switch (config.Type)
        //     {
        //         case 26:
        //             var petId = PetInfoConfig.GetItemUnLockPet(itemId);
        //             properties = petModel.GetPetAttrAddDict(petId);
        //             break;
        //         case 41:
        //         case 42:
        //             var horseId = HorseConfig.GetItemUnLockHorse(itemId);
        //             properties = mountModel.GetMountAttrAddDict(horseId);
        //             break;
        //         default:
        //             break;
        //     }
        //     if (properties != null)
        //     {
        //         baseProperty.baseProperties = new List<Int2>();
        //         foreach (var property in properties)
        //         {
        //             baseProperty.baseProperties.Add(new Int2(property.Key, property.Value));
        //         }
        //     }
        //     return baseProperty;
        // }
        // //神装属性
        // private static ShenProperty GetShenProperty(int itemId)
        // {
        //     var data = new ShenProperty();
        //     data.isPreview = true;
        //     data.itemId = itemId;
        //     var config = ItemConfig.Get(itemId);
        //     data.properties = ShenPropertyUtility.GetEquipShenProperties(itemId);
        //     return data;
        // }
        // private static LegendProperty GetLegendProperty(int itemId)
        // {
        //     var data = new LegendProperty();
        //     data.isPreview = true;
        //     data.itemId = itemId;
        //     var config = ItemConfig.Get(itemId);
        //     if (config.Effect1 == 220)
        //     {
        //         data.isPreview = false;
        //         var appConfig = AppointItemConfig.Get(itemId);
        //         data.trueCount = 0;
        //         data.properties = new List<Int2>();
        //         for (var i = 0; i < appConfig.LegendAttrID.Length; i++)
        //         {
        //             data.properties.Add(new Int2(appConfig.LegendAttrID[i], appConfig.LegendAttrValue[i]));
        //         }
        //     }
        //     else
        //     {
        //         data.properties = LegendPropertyUtility.GetLegendProFromEquipShen(itemId);
        //         if (data.properties != null)
        //         {
        //             data.trueCount = 0;
        //             data.isPreview = false;
        //         }
        //         else
        //         {
        //             data.trueCount = LegendPropertyUtility.GetEquipPropertyCount(itemId);
        //             data.properties = LegendPropertyUtility.GetEquipProperties(itemId);
        //         }
        //     }
        //     return data;
        // }
        // private static SpiritWeaponProperty GetSpiritWeaponProperty(int itemId)
        // {
        //     var config = SpiritWeaponConfig.Get(itemId);
        //     if (config == null)
        //     {
        //         return default(SpiritWeaponProperty);
        //     }
        //     var properties = new List<Int3>();
        //     for (var i = 0; i < config.AttrIDList.Length; i++)
        //     {
        //         properties.Add(new Int3(config.AttrIDList[i], config.AttrValueList[i], config.AttrColorList[i]));
        //     }
        //     var spiritWeaponProperty = new SpiritWeaponProperty();
        //     spiritWeaponProperty.itemId = itemId;
        //     spiritWeaponProperty.properties = properties;
        //     return spiritWeaponProperty;
        // }
        // private static LegendProperty GetLegendProperty(string guid)
        // {
        //     var item = packModel.GetItemByGuid(guid);
        //     if (item == null)
        //     {
        //         return default(LegendProperty);
        //     }
        //     var data = new LegendProperty();
        //     data.isPreview = false;
        //     data.itemId = item.itemId;
        //     var ids = item.GetUseData((int)ItemUseDataKey.legendAttrID);
        //     var values = item.GetUseData((int)ItemUseDataKey.legendAttrValue);
        //     if (!ids.IsNullOrEmpty() && !values.IsNullOrEmpty())
        //     {
        //         var properties = new List<Int2>();
        //         var count = Mathf.Min(ids.Count, values.Count);
        //         for (int i = 0; i < count; i++)
        //         {
        //             properties.Add(new Int2(ids[i], values[i]));
        //         }
        //         data.properties = properties;
        //     }
        //     return data;
        // }
        public static LegendProperty GetLegendProperty(int itemId, Dictionary<int, List<int>> userData)
        if (equiped)
        {
            var data = new LegendProperty();
            data.isPreview = false;
            data.itemId = itemId;
            List<int> ids = null;
            List<int> values = null;
            if (userData != null)
            {
                userData.TryGetValue((int)ItemUseDataKey.legendAttrID, out ids);
                userData.TryGetValue((int)ItemUseDataKey.legendAttrValue, out values);
            }
            if (!ids.IsNullOrEmpty() && !values.IsNullOrEmpty())
            {
                var properties = new List<Int2>();
                var count = Mathf.Min(ids.Count, values.Count);
                for (int i = 0; i < count; i++)
                {
                    properties.Add(new Int2(ids[i], values[i]));
                }
                data.properties = properties;
            }
            return data;
        }
        // public static SuitInfo GetSuitInfo(int itemId)
        // {
        //     var config = ItemConfig.Get(itemId);
        //     if (config == null || config.SuiteiD <= 0)
        //     {
        //         return default(SuitInfo);
        //     }
        //     var job = config.JobLimit;
        //     var twoConfigs = EquipSuitConfig.GetConfigs(job, config.LV, EquipSuitType.TwoSuit);
        //     var name = twoConfigs[0].name;
        //     var level = config.LV;
        //     var places = new List<int>();
        //     places.Add(config.EquipPlace);
        //     //var suitInfo = new SuitInfo()
        //     //{
        //     //    name = name,
        //     //    level = level,
        //     //    job = job,
        //     //    places = places,
        //     //};
        //     var maxSuitLevel = EquipStarModel.GetMaxStarLevel(level);
        //     var placeStars = new Dictionary<int, int>();
        //     for (int i = 1; i <= 8; i++)
        //     {
        //         var equip = packModel.GetItemByGuid(equipModel.GetEquip(new Int2(level, i)));
        //         var hasSuit = equip != null && equip.config.SuiteiD > 0;
        //         if (hasSuit)
        //         {
        //             placeStars[i] = starModel.GetEquipStarLevel(new Int2(level, i));
        //         }
        //     }
        //     var twoSuitProperties = new Dictionary<int, EquipSuitPropertyEntry>();
        //     var fiveSuitProperties = new Dictionary<int, EquipSuitPropertyEntry>();
        //     var eightSuits = new Dictionary<int, bool>();
        //     var eightSuitLevel = equipModel.GetSuitLevel(config.LV, EquipSuitType.EightSuit);
        //     var twoSuitProperties0 = equipModel.GetEquipSuitEntry(config.LV, 0, EquipSuitType.TwoSuit);
        //     var fiveSuitProperties0 = equipModel.GetEquipSuitEntry(config.LV, 0, EquipSuitType.FiveSuit);
        //     twoSuitProperties[0] = twoSuitProperties0;
        //     fiveSuitProperties[0] = fiveSuitProperties0;
        //     eightSuits[0] = eightSuitLevel >= 0;
        //     if (maxSuitLevel >= 3)
        //     {
        //         twoSuitProperties[3] = equipModel.GetEquipSuitEntry(config.LV, 3, EquipSuitType.TwoSuit);
        //         fiveSuitProperties[3] = equipModel.GetEquipSuitEntry(config.LV, 3, EquipSuitType.FiveSuit);
        //         eightSuits[3] = eightSuitLevel >= 3;
        //     }
        //     if (maxSuitLevel >= 6)
        //     {
        //         twoSuitProperties[6] = equipModel.GetEquipSuitEntry(config.LV, 6, EquipSuitType.TwoSuit);
        //         fiveSuitProperties[6] = equipModel.GetEquipSuitEntry(config.LV, 6, EquipSuitType.FiveSuit);
        //         eightSuits[6] = eightSuitLevel >= 3;
        //     }
        //     if (maxSuitLevel >= 9)
        //     {
        //         twoSuitProperties[9] = equipModel.GetEquipSuitEntry(config.LV, 9, EquipSuitType.TwoSuit);
        //         fiveSuitProperties[9] = equipModel.GetEquipSuitEntry(config.LV, 9, EquipSuitType.FiveSuit);
        //         eightSuits[9] = eightSuitLevel >= 9;
        //     }
        //     var suitInfo = new SuitInfo()
        //     {
        //         name = name,
        //         level = level,
        //         job = job,
        //         maxSuitLevel = maxSuitLevel,
        //         places = places,
        //         placeStars = placeStars,
        //         twoSuitProperties = twoSuitProperties,
        //         fiveSuitProperties = fiveSuitProperties,
        //         eightSuits = eightSuits
        //     };
        //     return suitInfo;
        // }
        // private static SuitInfo GetSuitInfo(string guid)
        // {
        //     var item = packModel.GetItemByGuid(guid);
        //     if (item == null)
        //     {
        //         return default(SuitInfo);
        //     }
        //     var config = ItemConfig.Get(item.itemId);
        //     if (config == null || config.SuiteiD <= 0)
        //     {
        //         return default(SuitInfo);
        //     }
        //     var equipPosition = new Int2(item.config.LV, item.config.EquipPlace);
        //     var equiped = equipModel.GetEquip(equipPosition) == guid;
        //     var job = config.JobLimit;
        //     var twoConfigs = EquipSuitConfig.GetConfigs(job, config.LV, EquipSuitType.TwoSuit);
        //     var name = twoConfigs[0].name;
        //     var level = config.LV;
        //     var maxSuitLevel = equiped ? EquipStarModel.GetMaxStarLevel(level) : -1;
        //     var places = new List<int>();
        //     var placeStars = new Dictionary<int, int>();
        //     if (equiped)
        //     {
        //         for (int i = 1; i <= 8; i++)
        //         {
        //             var equip = packModel.GetItemByGuid(equipModel.GetEquip(new Int2(level, i)));
        //             var hasSuit = equip != null && equip.config.SuiteiD > 0;
        //             if (hasSuit)
        //             {
        //                 places.Add(i);
        //                 placeStars[i] = starModel.GetEquipStarLevel(new Int2(level, i));
        //             }
        //         }
        //     }
        //     var twoSuitProperties = new Dictionary<int, EquipSuitPropertyEntry>();
        //     var fiveSuitProperties = new Dictionary<int, EquipSuitPropertyEntry>();
        //     var eightSuits = new Dictionary<int, bool>();
        //     var eightSuitLevel = equiped ? equipModel.GetSuitLevel(config.LV, EquipSuitType.EightSuit) : -1;
        //     if (!equiped)
        //     {
        //         var suit2 = equipModel.GetEquipSuitEntry(config.LV, 0, EquipSuitType.TwoSuit);
        //         suit2.actived = false;
        //         var suit5 = equipModel.GetEquipSuitEntry(config.LV, 0, EquipSuitType.FiveSuit);
        //         suit5.actived = false;
        //         twoSuitProperties[0] = suit2;
        //         fiveSuitProperties[0] = suit5;
        //         eightSuits[0] = eightSuitLevel >= 0;
        //     }
        //     else
        //     {
        //         foreach (var star in EquipStarModel.StarList)
        //         {
        //             if (maxSuitLevel >= star)
        //             {
        //                 twoSuitProperties[star] = equipModel.GetEquipSuitEntry(config.LV, star, EquipSuitType.TwoSuit);
        //                 fiveSuitProperties[star] = equipModel.GetEquipSuitEntry(config.LV, star, EquipSuitType.FiveSuit);
        //                 eightSuits[star] = eightSuitLevel >= star;
        //             }
        //         }
        //     }
        //     var suitInfo = new SuitInfo()
        //     {
        //         name = name,
        //         level = level,
        //         job = job,
        //         maxSuitLevel = maxSuitLevel,
        //         places = places,
        //         placeStars = placeStars,
        //         twoSuitProperties = twoSuitProperties,
        //         fiveSuitProperties = fiveSuitProperties,
        //         eightSuits = eightSuits
        //     };
        //     return suitInfo;
        // }
        // private static StarInfo GetStarInfo(int itemId)
        // {
        //     var config = ItemConfig.Get(itemId);
        //     if (!EquipModel.IsRealmEquip(config.EquipPlace))
        //     {
        //         return default(StarInfo);
        //     }
        //     var starInfo = new StarInfo();
        //     starInfo.equipPosition = new Int2(config.LV, config.EquipPlace);
        //     starInfo.maxLevel = EquipStarModel.GetMaxStarLevel(config.ItemColor, config.LV);
        //     starInfo.starLevel = 0;
        //     return starInfo;
        // }
        // private static StarInfo GetStarInfo(string guid)
        // {
        //     var item = packModel.GetItemByGuid(guid);
        //     if (item == null)
        //     {
        //         return default(StarInfo);
        //     }
        //     if (!EquipModel.IsRealmEquip(item.config.EquipPlace))
        //     {
        //         return default(StarInfo);
        //     }
        //     var starInfo = new StarInfo();
        //     var equipPosition = new Int2(item.config.LV, item.config.EquipPlace);
        //     var equiped = equipModel.GetEquip(equipPosition) == guid;
        //     starInfo.equipPosition = equipPosition;
        //     starInfo.maxLevel = EquipStarModel.GetMaxStarLevel(item.config.ItemColor, item.config.LV);
        //     starInfo.starLevel = equiped ? starModel.GetStarLevel(equipPosition) : 0;
        //     return starInfo;
        // }
        // private static StrengthenProperty GetStrengthenProperty(string guid)
        // {
        //     var item = packModel.GetItemByGuid(guid);
        //     if (item == null)
        //     {
        //         return default(StrengthenProperty);
        //     }
        //     var level = item.config.LV;
        //     var place = item.config.EquipPlace;
        //     var equiped = equipModel.GetEquip(new Int2(level, place)) == guid;
        //     if (!equiped)
        //     {
        //         return default(StrengthenProperty);
        //     }
        //     var data = new StrengthenProperty();
        //     var strengthenLevel = strengthenModel.GetStrengthLevel(level, place);
        //     var type = EquipStrengthModel.GetEquipStrengthType(place);
        //     var maxStrengthenLevel = strengthenModel.GetEquipLevelMax(type, level);
        //     data.strengthenLevel = Mathf.Min(strengthenLevel, maxStrengthenLevel);
        //     data.evolveLevel = strengthenModel.GetStrengthEvolveLevel(level, place);
        //     data.equipPlace = place;
        //     data.properties = new List<Int2>();
        //     var config = ItemPlusConfig.GetTypeAndLevel(type, data.strengthenLevel);
        //     for (int i = 0; i < config.attType.Length; i++)
        //     {
        //         data.properties.Add(new Int2(config.attType[i], config.attValue[i]));
        //     }
        //     return data;
        // }
        // private static GemInfo GetGemInfo(int itemId)
        // {
        //     var config = ItemConfig.Get(itemId);
        //     var level = config.LV;
        //     var place = config.EquipPlace;
        //     var gemInfo = new GemInfo();
        //     var maxStar = EquipStarModel.GetMaxStarLevel(config.ItemColor, config.LV);
        //     gemInfo.activeStates = new Dictionary<int, bool>();
        //     for (int i = 0; i < 4; i++)
        //     {
        //         gemInfo.activeStates[i] = IsEquipGemHoleOpen(new Int2(level, place), maxStar, i);
        //     }
        //     return gemInfo;
        // }
        // private static GemInfo GetGemInfo(string guid)
        // {
        //     var item = packModel.GetItemByGuid(guid);
        //     if (item == null)
        //     {
        //         return default(GemInfo);
        //     }
        //     var level = item.config.LV;
        //     var place = item.config.EquipPlace;
        //     var gemInfo = new GemInfo();
        //     var maxStar = EquipStarModel.GetMaxStarLevel(item.config.ItemColor, item.config.LV);
        //     gemInfo.activeStates = new Dictionary<int, bool>();
        //     for (int i = 0; i < 4; i++)
        //     {
        //         gemInfo.activeStates[i] = IsEquipGemHoleOpen(new Int2(level, place), maxStar, i);
        //     }
        //     gemInfo.gems = new Dictionary<int, int>();
        //     if (item.packType == PackType.Equip)
        //     {
        //         int[] gems;
        //         if (gemModel.TryGetEquipGems(item.config.LV, item.config.EquipPlace, out gems))
        //         {
        //             for (int i = 0; i < gems.Length; i++)
        //             {
        //                 gemInfo.gems[i] = gems[i];
        //             }
        //         }
        //     }
        //     return gemInfo;
        // }
        // private static TrainProperty GetTrainProperty(string guid)
        // {
        //     var item = packModel.GetItemByGuid(guid);
        //     if (item == null)
        //     {
        //         return default(TrainProperty);
        //     }
        //     var equipPosition = new Int2(item.config.LV, item.config.EquipPlace);
        //     var equiped = equipModel.GetEquip(equipPosition) == guid;
        //     if (!equiped)
        //     {
        //         return default(TrainProperty);
        //     }
        //     var trainProperty = new TrainProperty();
        //     var star = Mathf.Min(EquipStarModel.GetMaxStarLevel(item.config.ItemColor, item.config.LV), starModel.GetEquipStarLevel(equipPosition));
        //     var type = EquipTrainModel.GetTrainType(equipPosition.y);
        //     var maxConfig = WashLevelMaxConfig.Get(type, star);
        //     var maxLevel = maxConfig == null ? 1 : maxConfig.levelMax;
        //     var trainLevel = Mathf.Min(maxLevel, trainModel.GetTrainLevel(equipPosition));
        //     trainProperty.level = trainLevel;
        //     var trainConfig = EquipWashConfig.Get(type, trainLevel);
        //     trainProperty.properties = new List<Int2>();
        //     if (trainConfig == null)
        //     {
        //         var trainConfigLevel1 = EquipWashConfig.Get(type, 1);
        //         trainProperty.properties.Add(new Int2(trainConfigLevel1.config.attType1, 0));
        //         trainProperty.properties.Add(new Int2(trainConfigLevel1.config.attType2, 0));
        //         //trainProperty.properties.Add(new Int2(trainConfigLevel1.config.attType3, 0));
        //     }
        //     else
        //     {
        //         var trainedProperties = trainModel.GetTrainedProperties(equipPosition);
        //         trainProperty.properties.Add(new Int2(trainConfig.config.attType1, Mathf.Min(trainedProperties.x, trainConfig.config.attMax1)));
        //         trainProperty.properties.Add(new Int2(trainConfig.config.attType2, Mathf.Min(trainedProperties.y, trainConfig.config.attMax2)));
        //         //trainProperty.properties.Add(new Int2(trainConfig.config.attType3, Mathf.Min(trainedProperties.z, trainConfig.config.attMax3)));
        //     }
        //     return trainProperty;
        // }
        private static SkillInfo GetSkillInfo(int itemId)
        {
            var config = ItemConfig.Get(itemId);
            if (config == null)
            {
                return default(SkillInfo);
            }
            var skillInfo = new SkillInfo();
            skillInfo.skills = new List<int>();
            if (config.AddSkill1 != 0)
            {
                skillInfo.skills.Add(config.AddSkill1);
            }
            if (config.AddSkill2 != 0)
            {
                skillInfo.skills.Add(config.AddSkill2);
            }
            return skillInfo;
        }
        private static SkillInfo GetSkillInfo(int itemId, CustomEquipInfo info)
        {
            var skillInfo = new SkillInfo();
            skillInfo.skills = new List<int>();
            if (!info.equipSkillList.IsNullOrEmpty())
            {
                skillInfo.skills = info.equipSkillList;
            }
            else
            {
                return GetSkillInfo(itemId);
            }
            return skillInfo;
        }
        // private static SkillInfo GetSkillInfo(int itemId, string guid)
        // {
        //     var skillInfo = new SkillInfo();
        //     skillInfo.skills = new List<int>();
        //     var item = packModel.GetItemByGuid(guid);
        //     if (item == null)
        //     {
        //         return GetSkillInfo(itemId);
        //     }
        //     var values = item.GetUseData((int)ItemUseDataKey.equipSkills);
        //     if (!values.IsNullOrEmpty())
        //     {
        //         skillInfo.skills = values;
        //     }
        //     else
        //     {
        //         return GetSkillInfo(itemId);
        //     }
        //     return skillInfo;
        // }
        // private static WingRefineMaterials GetWingRefineMaterials(string guid)
        // {
        //     var item = packModel.GetItemByGuid(guid);
        //     if (item == null)
        //     {
        //         return default(WingRefineMaterials);
        //     }
        //     if (item.config.Type != 113)
        //     {
        //         return default(WingRefineMaterials);
        //     }
        //     var refineMaterials = new WingRefineMaterials();
        //     refineMaterials.materials = new List<Int2>();
        //     var ids = item.GetUseData((int)ItemUseDataKey.wingMaterialItemID);
        //     var values = item.GetUseData((int)ItemUseDataKey.wingMaterialItemCount);
        //     if (!ids.IsNullOrEmpty() && !values.IsNullOrEmpty())
        //     {
        //         var min = Mathf.Min(ids.Count, values.Count);
        //         for (int i = 0; i < min; i++)
        //         {
        //             refineMaterials.materials.Add(new Int2(ids[i], values[i]));
        //         }
        //     }
        //     return refineMaterials;
        // }
        // private static GetWay GetGetWay(int itemId)
        // {
        //     var config = ItemConfig.Get(itemId);
        //     if (config == null)
        //     {
        //         return default(GetWay);
        //     }
        //     var getWay = new GetWay();
        //     getWay.itemId = itemId;
        //     getWay.ways = new List<int>();
        //     foreach (var way in config.GetWay)
        //     {
        //         var wayConfig = GetItemWaysConfig.Get(way);
        //         if (wayConfig.FuncOpenId == 0 || FuncOpen.Instance.IsFuncOpen(wayConfig.FuncOpenId))
        //         {
        //             int activityType = 0;  // 活动模板 参考OpenServerActivityCenter.ActivityType
        //             if (wayConfig.customize == 2)
        //             {
        //                 activityType = (int)OpenServerActivityCenter.ActivityType.AT_JRZF;
        //             }
        //             else if (wayConfig.customize == 3)
        //             {
        //                 activityType = (int)OpenServerActivityCenter.ActivityType.AT_HFHD;
        //             }
        //             if (wayConfig.ActiveType == -1 || OpenServerActivityCenter.Instance.IsActivityOpen(wayConfig.ActiveType, activityType))
        //             {
        //                 getWay.ways.Add(way);
        //             }
        //         }
        //     }
        //     return getWay;
        // }
        // private static List<ItemOperateType> GetOperates(int itemId, int itemCount = 0)
        // {
        //     var config = ItemConfig.Get(itemId);
        //     var operates = new List<ItemOperateType>();
        //     var lsItemID = 150;
        //     if (config.CanSell == 1 && itemId != lsItemID)
        //     {
        //         operates.Add(ItemOperateType.sell);
        //     }
        //     // if (itemCount > 1 && itemId != lsItemID)
        //     // {
        //     //     operates.Add(ItemOperateType.split);
        //     // }
        //     if (config.UseTag == 1)
        //     {
        //         if (itemId != lsItemID)
        //             operates.Add(ItemOperateType.makeUse);
        //         else
        //             operates.Add(ItemOperateType.lsExchange);
        //     }
        //     if (config.Type == 25 || config.Effect1 == 225)
        //     {
        //         operates.Add(ItemOperateType.inlay);
        //     }
        //     if (!config.JumpComposeCondi.IsNullOrEmpty())
        //     {
        //         var jumpId = 0;
        //         if (composeModel.CheckComposeItemById(itemId, out jumpId))
        //         {
        //             operates.Add(ItemOperateType.compose);
        //         }
        //     }
        //     return operates;
        // }
        // private static List<ItemOperateType> GetOperates(string guid)
        // {
        //     var item = packModel.GetItemByGuid(guid);
        //     if (item == null)
        //     {
        //         return null;
        //     }
        //     var operates = new List<ItemOperateType>();
        //     var packType = item.packType;
        //     if (WindowCenter.Instance.IsOpen("DepotWin"))
        //     {
        //         switch (packType)
        //         {
        //             case PackType.Warehouse:
        //                 operates.Add(ItemOperateType.putOut);
        //                 break;
        //             default:
        //                 operates.Add(ItemOperateType.putIn);
        //                 break;
        //         }
        //         return operates;
        //     }
        //     if (packType == PackType.Equip)
        //     {
        //         if (WindowCenter.Instance.IsOpen("RealmEquipWin"))
        //         {
        //             operates.Add(ItemOperateType.putOff);
        //             if (FuncOpen.Instance.IsFuncOpen(1))
        //             {
        //                 operates.Add(ItemOperateType.strength);
        //             }
        //             if (FuncOpen.Instance.IsFuncOpen(172))
        //             {
        //                 operates.Add(ItemOperateType.star);
        //             }
        //             if (FuncOpen.Instance.IsFuncOpen(2))
        //             {
        //                 operates.Add(ItemOperateType.inlay);
        //             }
        //             if (FuncOpen.Instance.IsFuncOpen(91))
        //             {
        //                 int limitLevel = 0;
        //                 if (equipModel.EquipLevelFuncID != null)
        //                     limitLevel = equipModel.EquipLevelFuncID[91];
        //                 if (item.config.LV >= limitLevel)
        //                     operates.Add(ItemOperateType.train);
        //             }
        //             if (EquipEvolveModel.Instance.IsShowEvolveBtn(item.itemId))
        //             {
        //                 operates.Add(ItemOperateType.default1);
        //             }
        //             return operates;
        //         }
        //         if (ItemLogicUtility.Instance.IsRealmEquip(item.itemId) && WindowCenter.Instance.IsOpen("RoleEquipWin"))
        //         {
        //             operates.Add(ItemOperateType.putOff);
        //             return operates;
        //         }
        //         if (ItemLogicUtility.Instance.IsSpiritWeapon(item.itemId) && WindowCenter.Instance.IsOpen("SpiritEquipBagWin"))
        //         {
        //             operates.Add(ItemOperateType.putOff);
        //             return operates;
        //         }
        //     }
        //     if (packType == PackType.Warehouse)
        //     {
        //         operates.Add(ItemOperateType.putOut);
        //         return operates;
        //     }
        //     if (item.isAuction)
        //     {
        //         operates.Add(ItemOperateType.putAway);
        //     }
        //     var isEquip = ItemLogicUtility.Instance.IsRealmEquip(item.itemId);
        //     var isSpiritWeapon = ItemLogicUtility.Instance.IsSpiritWeapon(item.itemId);
        //     if (isEquip || isSpiritWeapon)
        //     {
        //         var isOverdue = ItemLogicUtility.Instance.IsOverdue(guid);
        //         if (item.config.CanSell == 1)
        //         {
        //             operates.Add(ItemOperateType.sell);
        //         }
        //         if (item.config.ExpireTime > 0 && isOverdue && itemOverdueModel.CanRenewal(item.itemId))
        //         {
        //             operates.Add(ItemOperateType.renewal);
        //         }
        //         if (!isOverdue)
        //         {
        //             if (ItemLogicUtility.Instance.IsJobCompatibleItem(item.itemId))
        //             {
        //                 if (isEquip)
        //                 {
        //                     operates.Add(ItemOperateType.putOn);
        //                     if (!item.config.JumpComposeCondi.IsNullOrEmpty())
        //                     {
        //                         var jumpId = 0;
        //                         if (composeModel.CheckComposeItemById(item.itemId, out jumpId))
        //                         {
        //                             operates.Add(ItemOperateType.compose);
        //                         }
        //                     }
        //                 }
        //                 if (isSpiritWeapon)
        //                 {
        //                     if (WindowCenter.Instance.IsOpen<RoleEquipWin>())
        //                     {
        //                         operates.Add(ItemOperateType.putOn);
        //                     }
        //                     else if (WindowCenter.Instance.IsOpen<MainInterfaceWin>() || WindowCenter.Instance.IsOpen("SpiritEquipBagWin"))
        //                     {
        //                         operates.Add(ItemOperateType.putOn);
        //                     }
        //                 }
        //             }
        //             //else
        //             //{
        //             //    if (item.config.ItemColor > 3)
        //             //    {
        //             //        operates.Add(ItemOperateType.exchange);
        //             //    }
        //             //}
        //         }
        //         return operates;
        //     }
        //     if (ItemLogicUtility.Instance.IsDogzEquip(item.itemId))
        //     {
        //         if (packType == PackType.DogzItem)
        //         {
        //             if (item.config.ItemColor > 2 && item.config.ItemColor < 6)
        //             {
        //                 operates.Add(ItemOperateType.compose);
        //             }
        //             operates.Add(ItemOperateType.putOn);
        //         }
        //         else if (packType == PackType.DogzEquip)
        //         {
        //             operates.Add(ItemOperateType.putOff);
        //         }
        //         return operates;
        //     }
        //     operates.AddRange(GetOperates(item.itemId, item.count));
        //     return operates;
        // }
        private static List<ItemOperateType> GetGoodOperates(int goodId)
        {
            var operates = new List<ItemOperateType>();
            var countLimit = BuyItemController.Instance.GetBuyCountLimit(goodId, PlayerDatas.Instance.baseData.VIPLv);
            if (countLimit == -1 || countLimit > 0)
            {
                var config = StoreConfig.Get(goodId);
                int curVipIndex = -1;
                int nextVipIndex = -1;
                bool isVipBuy = BuyItemController.Instance.CheckIsVipBuy(config, out curVipIndex, out nextVipIndex);
                if ((isVipBuy && curVipIndex == -1) || PlayerDatas.Instance.baseData.LV < config.LV)
                {
                    return operates;
                }
                operates.Add(ItemOperateType.buy);
            }
            return operates;
        }
        // private static bool IsEquipGemHoleOpen(Int2 equipPosition, int maxStar, int hole)
        // {
        //     GemHoleCondition condition;
        //     if (gemModel.TryGetGemHoleCondition(hole, out condition))
        //     {
        //         var star = starModel.GetStarLevel(equipPosition);
        //         if (Mathf.Min(star, maxStar) < condition.equipStar)
        //         {
        //             return false;
        //         }
        //         var vipLevel = PlayerDatas.Instance.baseData.VIPLv;
        //         if (vipLevel < condition.vipLevel)
        //         {
        //             return false;
        //         }
        //     }
        //     return true;
        // }
        private static TipType GetTipType(int itemId)
        {
            if (GeneralDefine.chestDisplayItems.Contains(itemId))
            {
                return TipType.PeerlessChest;
            }
            // if (ChestsAwardConfig.IsBox(itemId))
            var starProperties = new List<Int2>();
            // var currentStar = starModel.GetEquipStarLevel(equipPosition);
            // var maxStar = EquipStarModel.GetMaxStarLevel(item.config.ItemColor, item.config.LV);
            // var star = Mathf.Min(currentStar, maxStar);
            // if (star > 0)
            // {
            //     return TipType.BoxItem;
            //     baseProperty.star = star;
            //     var starConfig = EquipStarConfig.Get(item.config.LV, item.config.EquipPlace, star);
            //     starProperties.AddRange(starConfig.BaseAttrInfo);
            // }
            var config = ItemConfig.Get(itemId);
            switch (config.Type)
            baseProperty.starProperties = starProperties;
        }
        return baseProperty;
    }
    // private static BaseProperty GetPetMountBaseProperty(int itemId)
    // {
    //     var config = ItemConfig.Get(itemId);
    //     var baseProperty = new BaseProperty();
    //     Dictionary<int, int> properties = null;
    //     switch (config.Type)
    //     {
    //         case 26:
    //             var petId = PetInfoConfig.GetItemUnLockPet(itemId);
    //             properties = petModel.GetPetAttrAddDict(petId);
    //             break;
    //         case 41:
    //         case 42:
    //             var horseId = HorseConfig.GetItemUnLockHorse(itemId);
    //             properties = mountModel.GetMountAttrAddDict(horseId);
    //             break;
    //         default:
    //             break;
    //     }
    //     if (properties != null)
    //     {
    //         baseProperty.baseProperties = new List<Int2>();
    //         foreach (var property in properties)
    //         {
    //             baseProperty.baseProperties.Add(new Int2(property.Key, property.Value));
    //         }
    //     }
    //     return baseProperty;
    // }
    // //神装属性
    // private static ShenProperty GetShenProperty(int itemId)
    // {
    //     var data = new ShenProperty();
    //     data.isPreview = true;
    //     data.itemId = itemId;
    //     var config = ItemConfig.Get(itemId);
    //     data.properties = ShenPropertyUtility.GetEquipShenProperties(itemId);
    //     return data;
    // }
    // private static LegendProperty GetLegendProperty(int itemId)
    // {
    //     var data = new LegendProperty();
    //     data.isPreview = true;
    //     data.itemId = itemId;
    //     var config = ItemConfig.Get(itemId);
    //     if (config.Effect1 == 220)
    //     {
    //         data.isPreview = false;
    //         var appConfig = AppointItemConfig.Get(itemId);
    //         data.trueCount = 0;
    //         data.properties = new List<Int2>();
    //         for (var i = 0; i < appConfig.LegendAttrID.Length; i++)
    //         {
    //             data.properties.Add(new Int2(appConfig.LegendAttrID[i], appConfig.LegendAttrValue[i]));
    //         }
    //     }
    //     else
    //     {
    //         data.properties = LegendPropertyUtility.GetLegendProFromEquipShen(itemId);
    //         if (data.properties != null)
    //         {
    //             data.trueCount = 0;
    //             data.isPreview = false;
    //         }
    //         else
    //         {
    //             data.trueCount = LegendPropertyUtility.GetEquipPropertyCount(itemId);
    //             data.properties = LegendPropertyUtility.GetEquipProperties(itemId);
    //         }
    //     }
    //     return data;
    // }
    // private static SpiritWeaponProperty GetSpiritWeaponProperty(int itemId)
    // {
    //     var config = SpiritWeaponConfig.Get(itemId);
    //     if (config == null)
    //     {
    //         return default(SpiritWeaponProperty);
    //     }
    //     var properties = new List<Int3>();
    //     for (var i = 0; i < config.AttrIDList.Length; i++)
    //     {
    //         properties.Add(new Int3(config.AttrIDList[i], config.AttrValueList[i], config.AttrColorList[i]));
    //     }
    //     var spiritWeaponProperty = new SpiritWeaponProperty();
    //     spiritWeaponProperty.itemId = itemId;
    //     spiritWeaponProperty.properties = properties;
    //     return spiritWeaponProperty;
    // }
    // private static LegendProperty GetLegendProperty(string guid)
    // {
    //     var item = packModel.GetItemByGuid(guid);
    //     if (item == null)
    //     {
    //         return default(LegendProperty);
    //     }
    //     var data = new LegendProperty();
    //     data.isPreview = false;
    //     data.itemId = item.itemId;
    //     var ids = item.GetUseData((int)ItemUseDataKey.legendAttrID);
    //     var values = item.GetUseData((int)ItemUseDataKey.legendAttrValue);
    //     if (!ids.IsNullOrEmpty() && !values.IsNullOrEmpty())
    //     {
    //         var properties = new List<Int2>();
    //         var count = Mathf.Min(ids.Count, values.Count);
    //         for (int i = 0; i < count; i++)
    //         {
    //             properties.Add(new Int2(ids[i], values[i]));
    //         }
    //         data.properties = properties;
    //     }
    //     return data;
    // }
    public static LegendProperty GetLegendProperty(int itemId, Dictionary<int, List<int>> userData)
    {
        var data = new LegendProperty();
        data.isPreview = false;
        data.itemId = itemId;
        List<int> ids = null;
        List<int> values = null;
        if (userData != null)
        {
            userData.TryGetValue((int)ItemUseDataKey.legendAttrID, out ids);
            userData.TryGetValue((int)ItemUseDataKey.legendAttrValue, out values);
        }
        if (!ids.IsNullOrEmpty() && !values.IsNullOrEmpty())
        {
            var properties = new List<Int2>();
            var count = Mathf.Min(ids.Count, values.Count);
            for (int i = 0; i < count; i++)
            {
                case 101:
                case 102:
                case 103:
                case 104:
                case 105:
                case 106:
                case 107:
                case 108:
                case 109:
                case 110:
                case 111:
                case 112:
                    return TipType.Equip;
                case 26:
                case 41:
                case 42:
                    return TipType.PetMount;
                case 147:
                    return TipType.TreasurePavilion;
                default:
                    return TipType.Item;
                properties.Add(new Int2(ids[i], values[i]));
            }
            data.properties = properties;
        }
        [System.Diagnostics.Conditional("UNITY_EDITOR")]
        private static void PrintItemBrief(int itemId)
        return data;
    }
    // public static SuitInfo GetSuitInfo(int itemId)
    // {
    //     var config = ItemConfig.Get(itemId);
    //     if (config == null || config.SuiteiD <= 0)
    //     {
    //         return default(SuitInfo);
    //     }
    //     var job = config.JobLimit;
    //     var twoConfigs = EquipSuitConfig.GetConfigs(job, config.LV, EquipSuitType.TwoSuit);
    //     var name = twoConfigs[0].name;
    //     var level = config.LV;
    //     var places = new List<int>();
    //     places.Add(config.EquipPlace);
    //     //var suitInfo = new SuitInfo()
    //     //{
    //     //    name = name,
    //     //    level = level,
    //     //    job = job,
    //     //    places = places,
    //     //};
    //     var maxSuitLevel = EquipStarModel.GetMaxStarLevel(level);
    //     var placeStars = new Dictionary<int, int>();
    //     for (int i = 1; i <= 8; i++)
    //     {
    //         var equip = packModel.GetItemByGuid(equipModel.GetEquip(new Int2(level, i)));
    //         var hasSuit = equip != null && equip.config.SuiteiD > 0;
    //         if (hasSuit)
    //         {
    //             placeStars[i] = starModel.GetEquipStarLevel(new Int2(level, i));
    //         }
    //     }
    //     var twoSuitProperties = new Dictionary<int, EquipSuitPropertyEntry>();
    //     var fiveSuitProperties = new Dictionary<int, EquipSuitPropertyEntry>();
    //     var eightSuits = new Dictionary<int, bool>();
    //     var eightSuitLevel = equipModel.GetSuitLevel(config.LV, EquipSuitType.EightSuit);
    //     var twoSuitProperties0 = equipModel.GetEquipSuitEntry(config.LV, 0, EquipSuitType.TwoSuit);
    //     var fiveSuitProperties0 = equipModel.GetEquipSuitEntry(config.LV, 0, EquipSuitType.FiveSuit);
    //     twoSuitProperties[0] = twoSuitProperties0;
    //     fiveSuitProperties[0] = fiveSuitProperties0;
    //     eightSuits[0] = eightSuitLevel >= 0;
    //     if (maxSuitLevel >= 3)
    //     {
    //         twoSuitProperties[3] = equipModel.GetEquipSuitEntry(config.LV, 3, EquipSuitType.TwoSuit);
    //         fiveSuitProperties[3] = equipModel.GetEquipSuitEntry(config.LV, 3, EquipSuitType.FiveSuit);
    //         eightSuits[3] = eightSuitLevel >= 3;
    //     }
    //     if (maxSuitLevel >= 6)
    //     {
    //         twoSuitProperties[6] = equipModel.GetEquipSuitEntry(config.LV, 6, EquipSuitType.TwoSuit);
    //         fiveSuitProperties[6] = equipModel.GetEquipSuitEntry(config.LV, 6, EquipSuitType.FiveSuit);
    //         eightSuits[6] = eightSuitLevel >= 3;
    //     }
    //     if (maxSuitLevel >= 9)
    //     {
    //         twoSuitProperties[9] = equipModel.GetEquipSuitEntry(config.LV, 9, EquipSuitType.TwoSuit);
    //         fiveSuitProperties[9] = equipModel.GetEquipSuitEntry(config.LV, 9, EquipSuitType.FiveSuit);
    //         eightSuits[9] = eightSuitLevel >= 9;
    //     }
    //     var suitInfo = new SuitInfo()
    //     {
    //         name = name,
    //         level = level,
    //         job = job,
    //         maxSuitLevel = maxSuitLevel,
    //         places = places,
    //         placeStars = placeStars,
    //         twoSuitProperties = twoSuitProperties,
    //         fiveSuitProperties = fiveSuitProperties,
    //         eightSuits = eightSuits
    //     };
    //     return suitInfo;
    // }
    // private static SuitInfo GetSuitInfo(string guid)
    // {
    //     var item = packModel.GetItemByGuid(guid);
    //     if (item == null)
    //     {
    //         return default(SuitInfo);
    //     }
    //     var config = ItemConfig.Get(item.itemId);
    //     if (config == null || config.SuiteiD <= 0)
    //     {
    //         return default(SuitInfo);
    //     }
    //     var equipPosition = new Int2(item.config.LV, item.config.EquipPlace);
    //     var equiped = equipModel.GetEquip(equipPosition) == guid;
    //     var job = config.JobLimit;
    //     var twoConfigs = EquipSuitConfig.GetConfigs(job, config.LV, EquipSuitType.TwoSuit);
    //     var name = twoConfigs[0].name;
    //     var level = config.LV;
    //     var maxSuitLevel = equiped ? EquipStarModel.GetMaxStarLevel(level) : -1;
    //     var places = new List<int>();
    //     var placeStars = new Dictionary<int, int>();
    //     if (equiped)
    //     {
    //         for (int i = 1; i <= 8; i++)
    //         {
    //             var equip = packModel.GetItemByGuid(equipModel.GetEquip(new Int2(level, i)));
    //             var hasSuit = equip != null && equip.config.SuiteiD > 0;
    //             if (hasSuit)
    //             {
    //                 places.Add(i);
    //                 placeStars[i] = starModel.GetEquipStarLevel(new Int2(level, i));
    //             }
    //         }
    //     }
    //     var twoSuitProperties = new Dictionary<int, EquipSuitPropertyEntry>();
    //     var fiveSuitProperties = new Dictionary<int, EquipSuitPropertyEntry>();
    //     var eightSuits = new Dictionary<int, bool>();
    //     var eightSuitLevel = equiped ? equipModel.GetSuitLevel(config.LV, EquipSuitType.EightSuit) : -1;
    //     if (!equiped)
    //     {
    //         var suit2 = equipModel.GetEquipSuitEntry(config.LV, 0, EquipSuitType.TwoSuit);
    //         suit2.actived = false;
    //         var suit5 = equipModel.GetEquipSuitEntry(config.LV, 0, EquipSuitType.FiveSuit);
    //         suit5.actived = false;
    //         twoSuitProperties[0] = suit2;
    //         fiveSuitProperties[0] = suit5;
    //         eightSuits[0] = eightSuitLevel >= 0;
    //     }
    //     else
    //     {
    //         foreach (var star in EquipStarModel.StarList)
    //         {
    //             if (maxSuitLevel >= star)
    //             {
    //                 twoSuitProperties[star] = equipModel.GetEquipSuitEntry(config.LV, star, EquipSuitType.TwoSuit);
    //                 fiveSuitProperties[star] = equipModel.GetEquipSuitEntry(config.LV, star, EquipSuitType.FiveSuit);
    //                 eightSuits[star] = eightSuitLevel >= star;
    //             }
    //         }
    //     }
    //     var suitInfo = new SuitInfo()
    //     {
    //         name = name,
    //         level = level,
    //         job = job,
    //         maxSuitLevel = maxSuitLevel,
    //         places = places,
    //         placeStars = placeStars,
    //         twoSuitProperties = twoSuitProperties,
    //         fiveSuitProperties = fiveSuitProperties,
    //         eightSuits = eightSuits
    //     };
    //     return suitInfo;
    // }
    // private static StarInfo GetStarInfo(int itemId)
    // {
    //     var config = ItemConfig.Get(itemId);
    //     if (!EquipModel.IsRealmEquip(config.EquipPlace))
    //     {
    //         return default(StarInfo);
    //     }
    //     var starInfo = new StarInfo();
    //     starInfo.equipPosition = new Int2(config.LV, config.EquipPlace);
    //     starInfo.maxLevel = EquipStarModel.GetMaxStarLevel(config.ItemColor, config.LV);
    //     starInfo.starLevel = 0;
    //     return starInfo;
    // }
    // private static StarInfo GetStarInfo(string guid)
    // {
    //     var item = packModel.GetItemByGuid(guid);
    //     if (item == null)
    //     {
    //         return default(StarInfo);
    //     }
    //     if (!EquipModel.IsRealmEquip(item.config.EquipPlace))
    //     {
    //         return default(StarInfo);
    //     }
    //     var starInfo = new StarInfo();
    //     var equipPosition = new Int2(item.config.LV, item.config.EquipPlace);
    //     var equiped = equipModel.GetEquip(equipPosition) == guid;
    //     starInfo.equipPosition = equipPosition;
    //     starInfo.maxLevel = EquipStarModel.GetMaxStarLevel(item.config.ItemColor, item.config.LV);
    //     starInfo.starLevel = equiped ? starModel.GetStarLevel(equipPosition) : 0;
    //     return starInfo;
    // }
    // private static StrengthenProperty GetStrengthenProperty(string guid)
    // {
    //     var item = packModel.GetItemByGuid(guid);
    //     if (item == null)
    //     {
    //         return default(StrengthenProperty);
    //     }
    //     var level = item.config.LV;
    //     var place = item.config.EquipPlace;
    //     var equiped = equipModel.GetEquip(new Int2(level, place)) == guid;
    //     if (!equiped)
    //     {
    //         return default(StrengthenProperty);
    //     }
    //     var data = new StrengthenProperty();
    //     var strengthenLevel = strengthenModel.GetStrengthLevel(level, place);
    //     var type = EquipStrengthModel.GetEquipStrengthType(place);
    //     var maxStrengthenLevel = strengthenModel.GetEquipLevelMax(type, level);
    //     data.strengthenLevel = Mathf.Min(strengthenLevel, maxStrengthenLevel);
    //     data.evolveLevel = strengthenModel.GetStrengthEvolveLevel(level, place);
    //     data.equipPlace = place;
    //     data.properties = new List<Int2>();
    //     var config = ItemPlusConfig.GetTypeAndLevel(type, data.strengthenLevel);
    //     for (int i = 0; i < config.attType.Length; i++)
    //     {
    //         data.properties.Add(new Int2(config.attType[i], config.attValue[i]));
    //     }
    //     return data;
    // }
    // private static GemInfo GetGemInfo(int itemId)
    // {
    //     var config = ItemConfig.Get(itemId);
    //     var level = config.LV;
    //     var place = config.EquipPlace;
    //     var gemInfo = new GemInfo();
    //     var maxStar = EquipStarModel.GetMaxStarLevel(config.ItemColor, config.LV);
    //     gemInfo.activeStates = new Dictionary<int, bool>();
    //     for (int i = 0; i < 4; i++)
    //     {
    //         gemInfo.activeStates[i] = IsEquipGemHoleOpen(new Int2(level, place), maxStar, i);
    //     }
    //     return gemInfo;
    // }
    // private static GemInfo GetGemInfo(string guid)
    // {
    //     var item = packModel.GetItemByGuid(guid);
    //     if (item == null)
    //     {
    //         return default(GemInfo);
    //     }
    //     var level = item.config.LV;
    //     var place = item.config.EquipPlace;
    //     var gemInfo = new GemInfo();
    //     var maxStar = EquipStarModel.GetMaxStarLevel(item.config.ItemColor, item.config.LV);
    //     gemInfo.activeStates = new Dictionary<int, bool>();
    //     for (int i = 0; i < 4; i++)
    //     {
    //         gemInfo.activeStates[i] = IsEquipGemHoleOpen(new Int2(level, place), maxStar, i);
    //     }
    //     gemInfo.gems = new Dictionary<int, int>();
    //     if (item.packType == PackType.Equip)
    //     {
    //         int[] gems;
    //         if (gemModel.TryGetEquipGems(item.config.LV, item.config.EquipPlace, out gems))
    //         {
    //             for (int i = 0; i < gems.Length; i++)
    //             {
    //                 gemInfo.gems[i] = gems[i];
    //             }
    //         }
    //     }
    //     return gemInfo;
    // }
    // private static TrainProperty GetTrainProperty(string guid)
    // {
    //     var item = packModel.GetItemByGuid(guid);
    //     if (item == null)
    //     {
    //         return default(TrainProperty);
    //     }
    //     var equipPosition = new Int2(item.config.LV, item.config.EquipPlace);
    //     var equiped = equipModel.GetEquip(equipPosition) == guid;
    //     if (!equiped)
    //     {
    //         return default(TrainProperty);
    //     }
    //     var trainProperty = new TrainProperty();
    //     var star = Mathf.Min(EquipStarModel.GetMaxStarLevel(item.config.ItemColor, item.config.LV), starModel.GetEquipStarLevel(equipPosition));
    //     var type = EquipTrainModel.GetTrainType(equipPosition.y);
    //     var maxConfig = WashLevelMaxConfig.Get(type, star);
    //     var maxLevel = maxConfig == null ? 1 : maxConfig.levelMax;
    //     var trainLevel = Mathf.Min(maxLevel, trainModel.GetTrainLevel(equipPosition));
    //     trainProperty.level = trainLevel;
    //     var trainConfig = EquipWashConfig.Get(type, trainLevel);
    //     trainProperty.properties = new List<Int2>();
    //     if (trainConfig == null)
    //     {
    //         var trainConfigLevel1 = EquipWashConfig.Get(type, 1);
    //         trainProperty.properties.Add(new Int2(trainConfigLevel1.config.attType1, 0));
    //         trainProperty.properties.Add(new Int2(trainConfigLevel1.config.attType2, 0));
    //         //trainProperty.properties.Add(new Int2(trainConfigLevel1.config.attType3, 0));
    //     }
    //     else
    //     {
    //         var trainedProperties = trainModel.GetTrainedProperties(equipPosition);
    //         trainProperty.properties.Add(new Int2(trainConfig.config.attType1, Mathf.Min(trainedProperties.x, trainConfig.config.attMax1)));
    //         trainProperty.properties.Add(new Int2(trainConfig.config.attType2, Mathf.Min(trainedProperties.y, trainConfig.config.attMax2)));
    //         //trainProperty.properties.Add(new Int2(trainConfig.config.attType3, Mathf.Min(trainedProperties.z, trainConfig.config.attMax3)));
    //     }
    //     return trainProperty;
    // }
    private static SkillInfo GetSkillInfo(int itemId)
    {
        var config = ItemConfig.Get(itemId);
        if (config == null)
        {
            var config = ItemConfig.Get(itemId);
            Debug.LogFormat("你查看的物品是:itemId->{0} ;name->{1}", itemId, config.ItemName);
            return default(SkillInfo);
        }
        [System.Diagnostics.Conditional("UNITY_EDITOR")]
        private static void PrintItemBrief(int itemId, string guid)
        var skillInfo = new SkillInfo();
        skillInfo.skills = new List<int>();
        if (config.AddSkill1 != 0)
        {
            var config = ItemConfig.Get(itemId);
            Debug.LogFormat("你查看的物品是:itemId->{0};name->{1};guid->{2};", itemId, config.ItemName, string.IsNullOrEmpty(guid) ? "" : guid);
            skillInfo.skills.Add(config.AddSkill1);
        }
        if (config.AddSkill2 != 0)
        {
            skillInfo.skills.Add(config.AddSkill2);
        }
        return skillInfo;
    }
    private static SkillInfo GetSkillInfo(int itemId, CustomEquipInfo info)
    {
        var skillInfo = new SkillInfo();
        skillInfo.skills = new List<int>();
        if (!info.equipSkillList.IsNullOrEmpty())
        {
            skillInfo.skills = info.equipSkillList;
        }
        else
        {
            return GetSkillInfo(itemId);
        }
        return skillInfo;
    }
    // private static SkillInfo GetSkillInfo(int itemId, string guid)
    // {
    //     var skillInfo = new SkillInfo();
    //     skillInfo.skills = new List<int>();
    //     var item = packModel.GetItemByGuid(guid);
    //     if (item == null)
    //     {
    //         return GetSkillInfo(itemId);
    //     }
    //     var values = item.GetUseData((int)ItemUseDataKey.equipSkills);
    //     if (!values.IsNullOrEmpty())
    //     {
    //         skillInfo.skills = values;
    //     }
    //     else
    //     {
    //         return GetSkillInfo(itemId);
    //     }
    //     return skillInfo;
    // }
    // private static WingRefineMaterials GetWingRefineMaterials(string guid)
    // {
    //     var item = packModel.GetItemByGuid(guid);
    //     if (item == null)
    //     {
    //         return default(WingRefineMaterials);
    //     }
    //     if (item.config.Type != 113)
    //     {
    //         return default(WingRefineMaterials);
    //     }
    //     var refineMaterials = new WingRefineMaterials();
    //     refineMaterials.materials = new List<Int2>();
    //     var ids = item.GetUseData((int)ItemUseDataKey.wingMaterialItemID);
    //     var values = item.GetUseData((int)ItemUseDataKey.wingMaterialItemCount);
    //     if (!ids.IsNullOrEmpty() && !values.IsNullOrEmpty())
    //     {
    //         var min = Mathf.Min(ids.Count, values.Count);
    //         for (int i = 0; i < min; i++)
    //         {
    //             refineMaterials.materials.Add(new Int2(ids[i], values[i]));
    //         }
    //     }
    //     return refineMaterials;
    // }
    // private static GetWay GetGetWay(int itemId)
    // {
    //     var config = ItemConfig.Get(itemId);
    //     if (config == null)
    //     {
    //         return default(GetWay);
    //     }
    //     var getWay = new GetWay();
    //     getWay.itemId = itemId;
    //     getWay.ways = new List<int>();
    //     foreach (var way in config.GetWay)
    //     {
    //         var wayConfig = GetItemWaysConfig.Get(way);
    //         if (wayConfig.FuncOpenId == 0 || FuncOpen.Instance.IsFuncOpen(wayConfig.FuncOpenId))
    //         {
    //             int activityType = 0;  // 活动模板 参考OpenServerActivityCenter.ActivityType
    //             if (wayConfig.customize == 2)
    //             {
    //                 activityType = (int)OpenServerActivityCenter.ActivityType.AT_JRZF;
    //             }
    //             else if (wayConfig.customize == 3)
    //             {
    //                 activityType = (int)OpenServerActivityCenter.ActivityType.AT_HFHD;
    //             }
    //             if (wayConfig.ActiveType == -1 || OpenServerActivityCenter.Instance.IsActivityOpen(wayConfig.ActiveType, activityType))
    //             {
    //                 getWay.ways.Add(way);
    //             }
    //         }
    //     }
    //     return getWay;
    // }
    // private static List<ItemOperateType> GetOperates(int itemId, int itemCount = 0)
    // {
    //     var config = ItemConfig.Get(itemId);
    //     var operates = new List<ItemOperateType>();
    //     var lsItemID = 150;
    //     if (config.CanSell == 1 && itemId != lsItemID)
    //     {
    //         operates.Add(ItemOperateType.sell);
    //     }
    //     // if (itemCount > 1 && itemId != lsItemID)
    //     // {
    //     //     operates.Add(ItemOperateType.split);
    //     // }
    //     if (config.UseTag == 1)
    //     {
    //         if (itemId != lsItemID)
    //             operates.Add(ItemOperateType.makeUse);
    //         else
    //             operates.Add(ItemOperateType.lsExchange);
    //     }
    //     if (config.Type == 25 || config.Effect1 == 225)
    //     {
    //         operates.Add(ItemOperateType.inlay);
    //     }
    //     if (!config.JumpComposeCondi.IsNullOrEmpty())
    //     {
    //         var jumpId = 0;
    //         if (composeModel.CheckComposeItemById(itemId, out jumpId))
    //         {
    //             operates.Add(ItemOperateType.compose);
    //         }
    //     }
    //     return operates;
    // }
    // private static List<ItemOperateType> GetOperates(string guid)
    // {
    //     var item = packModel.GetItemByGuid(guid);
    //     if (item == null)
    //     {
    //         return null;
    //     }
    //     var operates = new List<ItemOperateType>();
    //     var packType = item.packType;
    //     if (WindowCenter.Instance.IsOpen("DepotWin"))
    //     {
    //         switch (packType)
    //         {
    //             case PackType.Warehouse:
    //                 operates.Add(ItemOperateType.putOut);
    //                 break;
    //             default:
    //                 operates.Add(ItemOperateType.putIn);
    //                 break;
    //         }
    //         return operates;
    //     }
    //     if (packType == PackType.Equip)
    //     {
    //         if (WindowCenter.Instance.IsOpen("RealmEquipWin"))
    //         {
    //             operates.Add(ItemOperateType.putOff);
    //             if (FuncOpen.Instance.IsFuncOpen(1))
    //             {
    //                 operates.Add(ItemOperateType.strength);
    //             }
    //             if (FuncOpen.Instance.IsFuncOpen(172))
    //             {
    //                 operates.Add(ItemOperateType.star);
    //             }
    //             if (FuncOpen.Instance.IsFuncOpen(2))
    //             {
    //                 operates.Add(ItemOperateType.inlay);
    //             }
    //             if (FuncOpen.Instance.IsFuncOpen(91))
    //             {
    //                 int limitLevel = 0;
    //                 if (equipModel.EquipLevelFuncID != null)
    //                     limitLevel = equipModel.EquipLevelFuncID[91];
    //                 if (item.config.LV >= limitLevel)
    //                     operates.Add(ItemOperateType.train);
    //             }
    //             if (EquipEvolveModel.Instance.IsShowEvolveBtn(item.itemId))
    //             {
    //                 operates.Add(ItemOperateType.default1);
    //             }
    //             return operates;
    //         }
    //         if (ItemLogicUtility.Instance.IsRealmEquip(item.itemId) && WindowCenter.Instance.IsOpen("RoleEquipWin"))
    //         {
    //             operates.Add(ItemOperateType.putOff);
    //             return operates;
    //         }
    //         if (ItemLogicUtility.Instance.IsSpiritWeapon(item.itemId) && WindowCenter.Instance.IsOpen("SpiritEquipBagWin"))
    //         {
    //             operates.Add(ItemOperateType.putOff);
    //             return operates;
    //         }
    //     }
    //     if (packType == PackType.Warehouse)
    //     {
    //         operates.Add(ItemOperateType.putOut);
    //         return operates;
    //     }
    //     if (item.isAuction)
    //     {
    //         operates.Add(ItemOperateType.putAway);
    //     }
    //     var isEquip = ItemLogicUtility.Instance.IsRealmEquip(item.itemId);
    //     var isSpiritWeapon = ItemLogicUtility.Instance.IsSpiritWeapon(item.itemId);
    //     if (isEquip || isSpiritWeapon)
    //     {
    //         var isOverdue = ItemLogicUtility.Instance.IsOverdue(guid);
    //         if (item.config.CanSell == 1)
    //         {
    //             operates.Add(ItemOperateType.sell);
    //         }
    //         if (item.config.ExpireTime > 0 && isOverdue && itemOverdueModel.CanRenewal(item.itemId))
    //         {
    //             operates.Add(ItemOperateType.renewal);
    //         }
    //         if (!isOverdue)
    //         {
    //             if (ItemLogicUtility.Instance.IsJobCompatibleItem(item.itemId))
    //             {
    //                 if (isEquip)
    //                 {
    //                     operates.Add(ItemOperateType.putOn);
    //                     if (!item.config.JumpComposeCondi.IsNullOrEmpty())
    //                     {
    //                         var jumpId = 0;
    //                         if (composeModel.CheckComposeItemById(item.itemId, out jumpId))
    //                         {
    //                             operates.Add(ItemOperateType.compose);
    //                         }
    //                     }
    //                 }
    //                 if (isSpiritWeapon)
    //                 {
    //                     if (WindowCenter.Instance.IsOpen<RoleEquipWin>())
    //                     {
    //                         operates.Add(ItemOperateType.putOn);
    //                     }
    //                     else if (WindowCenter.Instance.IsOpen<MainInterfaceWin>() || WindowCenter.Instance.IsOpen("SpiritEquipBagWin"))
    //                     {
    //                         operates.Add(ItemOperateType.putOn);
    //                     }
    //                 }
    //             }
    //             //else
    //             //{
    //             //    if (item.config.ItemColor > 3)
    //             //    {
    //             //        operates.Add(ItemOperateType.exchange);
    //             //    }
    //             //}
    //         }
    //         return operates;
    //     }
    //     if (ItemLogicUtility.Instance.IsDogzEquip(item.itemId))
    //     {
    //         if (packType == PackType.DogzItem)
    //         {
    //             if (item.config.ItemColor > 2 && item.config.ItemColor < 6)
    //             {
    //                 operates.Add(ItemOperateType.compose);
    //             }
    //             operates.Add(ItemOperateType.putOn);
    //         }
    //         else if (packType == PackType.DogzEquip)
    //         {
    //             operates.Add(ItemOperateType.putOff);
    //         }
    //         return operates;
    //     }
    //     operates.AddRange(GetOperates(item.itemId, item.count));
    //     return operates;
    // }
    private static List<ItemOperateType> GetGoodOperates(int goodId)
    {
        var operates = new List<ItemOperateType>();
        var countLimit = BuyItemController.Instance.GetBuyCountLimit(goodId, PlayerDatas.Instance.baseData.VIPLv);
        if (countLimit == -1 || countLimit > 0)
        {
            var config = StoreConfig.Get(goodId);
            int curVipIndex = -1;
            int nextVipIndex = -1;
            bool isVipBuy = BuyItemController.Instance.CheckIsVipBuy(config, out curVipIndex, out nextVipIndex);
            if ((isVipBuy && curVipIndex == -1) || PlayerDatas.Instance.baseData.LV < config.LV)
            {
                return operates;
            }
            operates.Add(ItemOperateType.buy);
        }
        return operates;
    }
    // private static bool IsEquipGemHoleOpen(Int2 equipPosition, int maxStar, int hole)
    // {
    //     GemHoleCondition condition;
    //     if (gemModel.TryGetGemHoleCondition(hole, out condition))
    //     {
    //         var star = starModel.GetStarLevel(equipPosition);
    //         if (Mathf.Min(star, maxStar) < condition.equipStar)
    //         {
    //             return false;
    //         }
    //         var vipLevel = PlayerDatas.Instance.baseData.VIPLv;
    //         if (vipLevel < condition.vipLevel)
    //         {
    //             return false;
    //         }
    //     }
    //     return true;
    // }
    private static TipType GetTipType(int itemId)
    {
        if (GeneralDefine.chestDisplayItems.Contains(itemId))
        {
            return TipType.PeerlessChest;
        }
        // if (ChestsAwardConfig.IsBox(itemId))
        // {
        //     return TipType.BoxItem;
        // }
        var config = ItemConfig.Get(itemId);
        switch (config.Type)
        {
            case 101:
            case 102:
            case 103:
            case 104:
            case 105:
            case 106:
            case 107:
            case 108:
            case 109:
            case 110:
            case 111:
            case 112:
                return TipType.Equip;
            case 26:
            case 41:
            case 42:
                return TipType.PetMount;
            case 147:
                return TipType.TreasurePavilion;
            default:
                return TipType.Item;
        }
    }
    [System.Diagnostics.Conditional("UNITY_EDITOR")]
    private static void PrintItemBrief(int itemId)
    {
        var config = ItemConfig.Get(itemId);
        Debug.LogFormat("查看物品:itemId->{0} ;name->{1}", itemId, config.ItemName);
    }
    [System.Diagnostics.Conditional("UNITY_EDITOR")]
    private static void PrintItemBrief(int itemId, ItemModel item)
    {
        var config = ItemConfig.Get(itemId);
        Debug.LogFormat("查看物品:itemId->{0};name->{1};服务端索引->{3};guid->{2}",
        itemId, config.ItemName, item.guid, item.gridIndex);
    }
}
Main/System/ItemTip/ItemTipWin.cs
New file
@@ -0,0 +1,27 @@
using System;
using UnityEngine;
using UnityEngine.UI;
/// <summary>
/// 物品基础信息
/// </summary>
public class ItemTipWin : UIBase
{
    [SerializeField] ItemCell itemCell;
    [SerializeField] Text nameText;
    [SerializeField] Text descText;
    protected override void OnPreOpen()
    {
        var item = ItemTipUtility.mainTipData.baseInfo;
        itemCell.Init(new ItemCellModel(item.itemId, false, (ulong)item.count));
        var itemConfig = ItemConfig.Get(item.itemId);
        nameText.text = itemConfig.ItemName;
        descText.text = itemConfig.Description;
    }
}
Main/System/ItemTip/ItemTipWin.cs.meta
New file
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 037e7adc04fdcd74ab67dcd5dc746114
MonoImporter:
  externalObjects: {}
  serializedVersion: 2
  defaultReferences: []
  executionOrder: 0
  icon: {instanceID: 0}
  userData:
  assetBundleName:
  assetBundleVariant:
Main/System/KnapSack/Logic/ComposeGirdCell.cs
New file
@@ -0,0 +1,25 @@
using UnityEngine;
using UnityEngine.UI;
/// <summary>
/// 合成格子
/// </summary>
public class ComposeGirdCell : MonoBehaviour
{
    [SerializeField] ItemCell itemCell;
    [SerializeField] Image fillImage;
    [SerializeField] Image fullImage;
    [SerializeField] Text processText;
    public void Display(int index)
    {
        var guid = PackManager.Instance.composeItemGuidList[index];
        var item = PackManager.Instance.GetItemByGuid(guid);
        if (item == null)
            return;
        itemCell.Init(item);
        itemCell.button.AddListener(()=>
        {
            //合成界面
        });
    }
}
Main/System/KnapSack/Logic/ComposeGirdCell.cs.meta
New file
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 3c64a63d0c44fce40a3d1b90b18b2324
MonoImporter:
  externalObjects: {}
  serializedVersion: 2
  defaultReferences: []
  executionOrder: 0
  icon: {instanceID: 0}
  userData:
  assetBundleName:
  assetBundleVariant:
Main/System/KnapSack/Logic/ItemLogicUtility.cs
@@ -5,1361 +5,1363 @@
using UnityEngine;
    public class ItemLogicUtility : Singleton<ItemLogicUtility>
public class ItemLogicUtility : Singleton<ItemLogicUtility>
{
    private string normalGSFormula;
    private List<int> equipBaseProperties = new List<int>();
    Dictionary<int, int> equipSkillScores = new Dictionary<int, int>();
    PackManager packModel { get { return PackManager.Instance; } }
    // BuffModel buffDatas { get { return ModelCenter.Instance.GetModel<BuffModel>(); } }
    // MountModel mountDatas { get { return ModelCenter.Instance.GetModel<MountModel>(); } }
    // PetModel petDatas { get { return ModelCenter.Instance.GetModel<PetModel>(); } }
    // StrengthenModel strengthDatas { get { return ModelCenter.Instance.GetModel<StrengthenModel>(); } }
    // MagicianModel magicianModel { get { return ModelCenter.Instance.GetModel<MagicianModel>(); } }
    // ComposeWinModel composeModel { get { return ModelCenter.Instance.GetModel<ComposeWinModel>(); } }
    // EquipModel equipModel { get { return ModelCenter.Instance.GetModel<EquipModel>(); } }
    // AlchemyModel alchemyModel { get { return ModelCenter.Instance.GetModel<AlchemyModel>(); } }
    public void Init()
    {
        private string normalGSFormula;
        var GSFormulaConfig = FuncConfigConfig.Get("EquipGSFormula");
        normalGSFormula = GSFormulaConfig.Numerical1;
        private List<int> equipBaseProperties = new List<int>();
        Dictionary<int, int> equipSkillScores = new Dictionary<int, int>();
        PackManager packModel { get { return PackManager.Instance; } }
        // BuffModel buffDatas { get { return ModelCenter.Instance.GetModel<BuffModel>(); } }
        // MountModel mountDatas { get { return ModelCenter.Instance.GetModel<MountModel>(); } }
        // PetModel petDatas { get { return ModelCenter.Instance.GetModel<PetModel>(); } }
        // StrengthenModel strengthDatas { get { return ModelCenter.Instance.GetModel<StrengthenModel>(); } }
        // MagicianModel magicianModel { get { return ModelCenter.Instance.GetModel<MagicianModel>(); } }
        // ComposeWinModel composeModel { get { return ModelCenter.Instance.GetModel<ComposeWinModel>(); } }
        // EquipModel equipModel { get { return ModelCenter.Instance.GetModel<EquipModel>(); } }
        // AlchemyModel alchemyModel { get { return ModelCenter.Instance.GetModel<AlchemyModel>(); } }
        public void Init()
        var equipSkillScoreJson = JsonMapper.ToObject(GSFormulaConfig.Numerical4);
        foreach (var key in equipSkillScoreJson.Keys)
        {
            var GSFormulaConfig = FuncConfigConfig.Get("EquipGSFormula");
            normalGSFormula = GSFormulaConfig.Numerical1;
            var equipSkillScoreJson = JsonMapper.ToObject(GSFormulaConfig.Numerical4);
            foreach (var key in equipSkillScoreJson.Keys)
            var skillId = 0;
            int.TryParse(key, out skillId);
            if (skillId != 0)
            {
                var skillId = 0;
                int.TryParse(key, out skillId);
                if (skillId != 0)
                {
                    equipSkillScores[skillId] = (int)equipSkillScoreJson[key];
                }
                equipSkillScores[skillId] = (int)equipSkillScoreJson[key];
            }
            var baseAttr = JsonMapper.ToObject(GSFormulaConfig.Numerical2);
            if (baseAttr.IsArray)
            {
                for (int i = 0; i < baseAttr.Count; i++)
                {
                    equipBaseProperties.Add(int.Parse(baseAttr[i].ToString()));
                }
            }
            DTC0102_tagCDBPlayer.beforePlayerDataInitializeEvent += OnBeforePlayerDataInitialize;
        }
        void OnBeforePlayerDataInitialize()
        var baseAttr = JsonMapper.ToObject(GSFormulaConfig.Numerical2);
        if (baseAttr.IsArray)
        {
            isPackResetOk = true;
            ClearSortedBetterEquip();
            for (int i = 0; i < baseAttr.Count; i++)
            {
                equipBaseProperties.Add(int.Parse(baseAttr[i].ToString()));
            }
        }
        #region 计算装备评分
        class EquipSorceProperties
        DTC0102_tagCDBPlayer.beforePlayerDataInitializeEvent += OnBeforePlayerDataInitialize;
    }
    void OnBeforePlayerDataInitialize()
    {
        isPackResetOk = true;
        ClearSortedBetterEquip();
    }
    #region 计算装备评分
    class EquipSorceProperties
    {
        Dictionary<int, int> properties = new Dictionary<int, int>();
        public int this[int id] { get { return properties[id]; } set { properties[id] = value; } }
        public List<int> Keys { get { return new List<int>(properties.Keys); } }
        void Add(int id, int value)
        {
            Dictionary<int, int> properties = new Dictionary<int, int>();
            public int this[int id] { get { return properties[id]; } set { properties[id] = value; } }
            public List<int> Keys { get { return new List<int>(properties.Keys); } }
            void Add(int id, int value)
            if (properties.ContainsKey(id))
            {
                if (properties.ContainsKey(id))
                {
                    properties[id] += value;
                }
                else
                {
                    properties[id] = value;
                }
            }
            public void AddRange(List<int> ids, List<int> values)
            {
                if (ids == null || values == null)
                {
                    return;
                }
                var count = Mathf.Min(ids.Count, values.Count);
                for (int i = 0; i < count; i++)
                {
                    Add(ids[i], values[i]);
                }
            }
            public void AddRange(int[] ids, int[] values)
            {
                if (ids == null || values == null)
                {
                    return;
                }
                var length = Mathf.Min(ids.Length, values.Length);
                for (int i = 0; i < length; i++)
                {
                    Add(ids[i], values[i]);
                }
            }
            public void AddRange(Dictionary<int, int> keyValues)
            {
                if (keyValues == null)
                {
                    return;
                }
                foreach (var item in keyValues)
                {
                    Add(item.Key, item.Value);
                }
            }
            public void AddBaseProperties(int itemId, List<int> reference)
            {
                var config = ItemConfig.Get(itemId);
                if (config == null)
                {
                    return;
                }
                if (config.Effect1 != 0 && reference.Contains(config.Effect1))
                {
                    properties.Add(config.Effect1, config.EffectValueA1);
                }
                if (config.Effect2 != 0 && reference.Contains(config.Effect2))
                {
                    properties.Add(config.Effect2, config.EffectValueA2);
                }
                if (config.Effect3 != 0 && reference.Contains(config.Effect3))
                {
                    properties.Add(config.Effect3, config.EffectValueA3);
                }
                if (config.Effect4 != 0 && reference.Contains(config.Effect4))
                {
                    properties.Add(config.Effect4, config.EffectValueA4);
                }
                if (config.Effect5 != 0 && reference.Contains(config.Effect5))
                {
                    properties.Add(config.Effect5, config.EffectValueA5);
                }
            }
            public void AddCustomProperties(int itemId)
            {
                if (!AppointItemConfig.HasKey(itemId))
                {
                    return;
                }
                var config = AppointItemConfig.Get(itemId);
                AddRange(config.LegendAttrID, config.LegendAttrValue);
            }
            public bool ContainsKey(int id)
            {
                return properties.ContainsKey(id);
            }
        }
        public int GetEquipScore(int itemId, Dictionary<int, List<int>> useDataDic = null, bool isPreview = false)
        {
            var config = ItemConfig.Get(itemId);
            if (config == null) return 0;
            if (config.EquipPlace == 0)
            {
                return 0;
            }
            var properties = new EquipSorceProperties();
            if (IsCustomItem(itemId))
            {
                properties.AddBaseProperties(config.EffectValueA1, equipBaseProperties);
                properties.AddCustomProperties(itemId);
                return CalculateEquipScore(config.EffectValueA1, properties);
            }
            properties.AddBaseProperties(itemId, equipBaseProperties);
            if (useDataDic != null)
            {
                if (useDataDic.ContainsKey((int)ItemUseDataKey.legendAttrID))
                {
                    properties.AddRange(useDataDic[(int)ItemUseDataKey.legendAttrID], useDataDic[(int)ItemUseDataKey.legendAttrValue]);
                }
                if (useDataDic.ContainsKey((int)ItemUseDataKey.outOfPrintAttrID))
                {
                    properties.AddRange(useDataDic[(int)ItemUseDataKey.outOfPrintAttrID], useDataDic[(int)ItemUseDataKey.outOfPrintAttrValue]);
                }
            }
            return CalculateEquipScore(itemId, properties, useDataDic);
        }
        // private Dictionary<int, int> GetEquipLegendProperties(int itemId)
        // {
        //     var legendProperties = LegendPropertyUtility.GetLegendProFromEquipShen(itemId);
        //     if (legendProperties == null)
        //         legendProperties = LegendPropertyUtility.GetEquipProperties(itemId);
        //     var properties = new Dictionary<int, int>();
        //     if (legendProperties != null)
        //     {
        //         foreach (var item in legendProperties)
        //         {
        //             properties[item.x] = item.y;
        //         }
        //     }
        //     return properties;
        // }
        // private Dictionary<int, int> GetEquipShenProperties(int itemId)
        // {
        //     var shenProperties = ShenPropertyUtility.GetEquipShenProperties(itemId);
        //     var properties = new Dictionary<int, int>();
        //     if (shenProperties != null)
        //     {
        //         foreach (var item in shenProperties)
        //         {
        //             properties[item.x] = item.y;
        //         }
        //     }
        //     return properties;
        // }
        public bool IsCustomItem(int itemId)
        {
            if (!ItemConfig.HasKey(itemId))
            {
                return false;
            }
            return ItemConfig.Get(itemId).Effect1 == 220;
        }
        /// <summary>
        /// 得到装备的评分
        /// </summary>
        /// <param name="itemId"></param>
        /// <returns></returns>
        private Dictionary<PropertyType, float> curEquipAttrDict = new Dictionary<PropertyType, float>(); //存储当前装备属性对应的数值 key 属性 value 属性值
        private int CalculateEquipScore(int itemId, EquipSorceProperties properties, Dictionary<int, List<int>> useDataDic = null)
        {
            var config = ItemConfig.Get(itemId);
            if (config == null || !GeneralDefine.CompareEquipPlaces.Contains(config.EquipPlace))
            {
                return 0;
            }
            //properties.AddRange(GetEquipShenProperties(itemId));
            var minAttack = properties.ContainsKey((int)PropertyType.MinAtk) ? properties[(int)PropertyType.MinAtk] : 0;
            var maxAttack = properties.ContainsKey((int)PropertyType.MaxAtk) ? properties[(int)PropertyType.MaxAtk] : 0;
            var attack = properties.ContainsKey((int)PropertyType.ATK) ? properties[(int)PropertyType.ATK] : 0;
            properties[(int)PropertyType.MinAtk] = minAttack + attack;
            properties[(int)PropertyType.MaxAtk] = maxAttack + attack;
            Equation.Instance.Clear();
            curEquipAttrDict.Clear();
            var GSProValueDict = EquipGSParamConfig.GetTagGsProValueDict(config.LV, config.ItemColor, config.SuiteiD > 0 ? 1 : 0, config.StarLevel);
            foreach (var key in properties.Keys)
            {
                var attrType = (PropertyType)key;
                switch (attrType)
                {
                    case PropertyType.ATKSPEED:
                    case PropertyType.OnlyFinalHurt:
                    case PropertyType.PVPAtkBackHP:
                    case PropertyType.MinAtk:
                    case PropertyType.MaxAtk:
                    case PropertyType.AddFinalHurt:
                    case PropertyType.ReduceFinalHurt:
                        curEquipAttrDict.Add(attrType, properties[key]);
                        break;
                    default:
                        if (GSProValueDict != null && GSProValueDict.ContainsKey(attrType))
                        {
                            var curProValue = properties[key] * GSProValueDict[attrType];
                            curEquipAttrDict.Add(attrType, curProValue);
                        }
                        else
                        {
                            curEquipAttrDict.Add(attrType, properties[key]);
                        }
                        break;
                }
            }
            foreach (var key in curEquipAttrDict.Keys)
            {
                var propertyConfig = PlayerPropertyConfig.Get((int)key);
                if (propertyConfig != null)
                {
                    Equation.Instance.AddKeyValue(propertyConfig.Parameter, curEquipAttrDict[key]);
                }
            }
            var skillScore = 0;
            if (useDataDic != null && useDataDic.ContainsKey((int)ItemUseDataKey.equipSkills))
            {
                for (int i = 0; i < useDataDic[(int)ItemUseDataKey.equipSkills].Count; i++)
                {
                    skillScore += equipSkillScores[useDataDic[(int)ItemUseDataKey.equipSkills][i]];
                }
                properties[id] += value;
            }
            else
            {
                if (config.AddSkill1 != 0 && equipSkillScores.ContainsKey(config.AddSkill1))
                {
                    skillScore += equipSkillScores[config.AddSkill1];
                }
                if (config.AddSkill2 != 0 && equipSkillScores.ContainsKey(config.AddSkill2))
                {
                    skillScore += equipSkillScores[config.AddSkill2];
                }
                properties[id] = value;
            }
            return skillScore + Equation.Instance.Eval<int>(normalGSFormula);
        }
        #endregion
        private bool CheckIsExtendGrid(int itemId)
        public void AddRange(List<int> ids, List<int> values)
        {
            SinglePack singlePack = packModel.GetSinglePack(PackType.Item);
            if (singlePack == null) return false;
            if (ids == null || values == null)
            {
                return;
            }
            int startLockIndex = singlePack.unlockedGridCount - PackManager.Instance.initBagGridCount;
            FuncConfigConfig _tagFuncModel = FuncConfigConfig.Get("OpenBagItem");
            int haveCount = packModel.GetItemCountByID(PackType.Item, itemId);
            Equation.Instance.Clear();
            Equation.Instance.AddKeyValue("index", startLockIndex + 1);
            int needTool = Equation.Instance.Eval<int>(_tagFuncModel.Numerical2);
            if (haveCount >= needTool)
            var count = Mathf.Min(ids.Count, values.Count);
            for (int i = 0; i < count; i++)
            {
                Add(ids[i], values[i]);
            }
        }
        public void AddRange(int[] ids, int[] values)
        {
            if (ids == null || values == null)
            {
                return;
            }
            var length = Mathf.Min(ids.Length, values.Length);
            for (int i = 0; i < length; i++)
            {
                Add(ids[i], values[i]);
            }
        }
        public void AddRange(Dictionary<int, int> keyValues)
        {
            if (keyValues == null)
            {
                return;
            }
            foreach (var item in keyValues)
            {
                Add(item.Key, item.Value);
            }
        }
        public void AddBaseProperties(int itemId, List<int> reference)
        {
            var config = ItemConfig.Get(itemId);
            if (config == null)
            {
                return;
            }
            if (config.Effect1 != 0 && reference.Contains(config.Effect1))
            {
                properties.Add(config.Effect1, config.EffectValueA1);
            }
            if (config.Effect2 != 0 && reference.Contains(config.Effect2))
            {
                properties.Add(config.Effect2, config.EffectValueA2);
            }
            if (config.Effect3 != 0 && reference.Contains(config.Effect3))
            {
                properties.Add(config.Effect3, config.EffectValueA3);
            }
            if (config.Effect4 != 0 && reference.Contains(config.Effect4))
            {
                properties.Add(config.Effect4, config.EffectValueA4);
            }
            if (config.Effect5 != 0 && reference.Contains(config.Effect5))
            {
                properties.Add(config.Effect5, config.EffectValueA5);
            }
        }
        public void AddCustomProperties(int itemId)
        {
            if (!AppointItemConfig.HasKey(itemId))
            {
                return;
            }
            var config = AppointItemConfig.Get(itemId);
            AddRange(config.LegendAttrID, config.LegendAttrValue);
        }
        public bool ContainsKey(int id)
        {
            return properties.ContainsKey(id);
        }
    }
    public int GetEquipScore(int itemId, Dictionary<int, List<int>> useDataDic = null, bool isPreview = false)
    {
        var config = ItemConfig.Get(itemId);
        if (config == null) return 0;
        if (config.EquipPlace == 0)
        {
            return 0;
        }
        var properties = new EquipSorceProperties();
        if (IsCustomItem(itemId))
        {
            properties.AddBaseProperties(config.EffectValueA1, equipBaseProperties);
            properties.AddCustomProperties(itemId);
            return CalculateEquipScore(config.EffectValueA1, properties);
        }
        properties.AddBaseProperties(itemId, equipBaseProperties);
        if (useDataDic != null)
        {
            if (useDataDic.ContainsKey((int)ItemUseDataKey.legendAttrID))
            {
                properties.AddRange(useDataDic[(int)ItemUseDataKey.legendAttrID], useDataDic[(int)ItemUseDataKey.legendAttrValue]);
            }
            if (useDataDic.ContainsKey((int)ItemUseDataKey.outOfPrintAttrID))
            {
                properties.AddRange(useDataDic[(int)ItemUseDataKey.outOfPrintAttrID], useDataDic[(int)ItemUseDataKey.outOfPrintAttrValue]);
            }
        }
        return CalculateEquipScore(itemId, properties, useDataDic);
    }
    // private Dictionary<int, int> GetEquipLegendProperties(int itemId)
    // {
    //     var legendProperties = LegendPropertyUtility.GetLegendProFromEquipShen(itemId);
    //     if (legendProperties == null)
    //         legendProperties = LegendPropertyUtility.GetEquipProperties(itemId);
    //     var properties = new Dictionary<int, int>();
    //     if (legendProperties != null)
    //     {
    //         foreach (var item in legendProperties)
    //         {
    //             properties[item.x] = item.y;
    //         }
    //     }
    //     return properties;
    // }
    // private Dictionary<int, int> GetEquipShenProperties(int itemId)
    // {
    //     var shenProperties = ShenPropertyUtility.GetEquipShenProperties(itemId);
    //     var properties = new Dictionary<int, int>();
    //     if (shenProperties != null)
    //     {
    //         foreach (var item in shenProperties)
    //         {
    //             properties[item.x] = item.y;
    //         }
    //     }
    //     return properties;
    // }
    public bool IsCustomItem(int itemId)
    {
        if (!ItemConfig.HasKey(itemId))
        {
            return false;
        }
        return ItemConfig.Get(itemId).Effect1 == 220;
    }
    /// <summary>
    /// 得到装备的评分
    /// </summary>
    /// <param name="itemId"></param>
    /// <returns></returns>
    private Dictionary<PropertyType, float> curEquipAttrDict = new Dictionary<PropertyType, float>(); //存储当前装备属性对应的数值 key 属性 value 属性值
    private int CalculateEquipScore(int itemId, EquipSorceProperties properties, Dictionary<int, List<int>> useDataDic = null)
    {
        var config = ItemConfig.Get(itemId);
        if (config == null || !GeneralDefine.CompareEquipPlaces.Contains(config.EquipPlace))
        {
            return 0;
        }
        //properties.AddRange(GetEquipShenProperties(itemId));
        var minAttack = properties.ContainsKey((int)PropertyType.MinAtk) ? properties[(int)PropertyType.MinAtk] : 0;
        var maxAttack = properties.ContainsKey((int)PropertyType.MaxAtk) ? properties[(int)PropertyType.MaxAtk] : 0;
        var attack = properties.ContainsKey((int)PropertyType.ATK) ? properties[(int)PropertyType.ATK] : 0;
        properties[(int)PropertyType.MinAtk] = minAttack + attack;
        properties[(int)PropertyType.MaxAtk] = maxAttack + attack;
        Equation.Instance.Clear();
        curEquipAttrDict.Clear();
        var GSProValueDict = EquipGSParamConfig.GetTagGsProValueDict(config.LV, config.ItemColor, config.SuiteiD > 0 ? 1 : 0, config.StarLevel);
        foreach (var key in properties.Keys)
        {
            var attrType = (PropertyType)key;
            switch (attrType)
            {
                case PropertyType.ATKSPEED:
                case PropertyType.OnlyFinalHurt:
                case PropertyType.PVPAtkBackHP:
                case PropertyType.MinAtk:
                case PropertyType.MaxAtk:
                case PropertyType.AddFinalHurt:
                case PropertyType.ReduceFinalHurt:
                    curEquipAttrDict.Add(attrType, properties[key]);
                    break;
                default:
                    if (GSProValueDict != null && GSProValueDict.ContainsKey(attrType))
                    {
                        var curProValue = properties[key] * GSProValueDict[attrType];
                        curEquipAttrDict.Add(attrType, curProValue);
                    }
                    else
                    {
                        curEquipAttrDict.Add(attrType, properties[key]);
                    }
                    break;
            }
        }
        foreach (var key in curEquipAttrDict.Keys)
        {
            var propertyConfig = PlayerPropertyConfig.Get((int)key);
            if (propertyConfig != null)
            {
                Equation.Instance.AddKeyValue(propertyConfig.Parameter, curEquipAttrDict[key]);
            }
        }
        var skillScore = 0;
        if (useDataDic != null && useDataDic.ContainsKey((int)ItemUseDataKey.equipSkills))
        {
            for (int i = 0; i < useDataDic[(int)ItemUseDataKey.equipSkills].Count; i++)
            {
                skillScore += equipSkillScores[useDataDic[(int)ItemUseDataKey.equipSkills][i]];
            }
        }
        else
        {
            if (config.AddSkill1 != 0 && equipSkillScores.ContainsKey(config.AddSkill1))
            {
                skillScore += equipSkillScores[config.AddSkill1];
            }
            if (config.AddSkill2 != 0 && equipSkillScores.ContainsKey(config.AddSkill2))
            {
                skillScore += equipSkillScores[config.AddSkill2];
            }
        }
        return skillScore + Equation.Instance.Eval<int>(normalGSFormula);
    }
    #endregion
    private bool CheckIsExtendGrid(int itemId)
    {
        SinglePack singlePack = packModel.GetSinglePack(PackType.Item);
        if (singlePack == null) return false;
        int startLockIndex = singlePack.unlockedGridCount - PackManager.Instance.initBagGridCount;
        FuncConfigConfig _tagFuncModel = FuncConfigConfig.Get("OpenBagItem");
        int haveCount = packModel.GetItemCountByID(PackType.Item, itemId);
        Equation.Instance.Clear();
        Equation.Instance.AddKeyValue("index", startLockIndex + 1);
        int needTool = Equation.Instance.Eval<int>(_tagFuncModel.Numerical2);
        if (haveCount >= needTool)
        {
            return true;
        }
        else
        {
            return false;
        }
    }
    public event Action<string> GetBetterEquipEvent; //得到更好的装备 value 物品的实例ID
    // public void OnGetEquip(ItemModel item)
    // {
    //     if (item == null)
    //     {
    //         return;
    //     }
    //     if (item.packType != PackType.Item)
    //     {
    //         return;
    //     }
    //     if (!IsJobCompatibleItem(item.itemId))
    //     {
    //         return;
    //     }
    //     int equipPlace = item.config.EquipPlace;
    //     if ((RoleEquipType)equipPlace == RoleEquipType.Wing)
    //     {
    //         var wing = packModel.GetItemByIndex(PackType.Equip, SpiritWeaponModel.WING_EQUIPINDEX);
    //         if (wing == null)
    //         {
    //             if (!SpiritWeaponModel.hasAutoEquipWing)
    //             {
    //                 SpiritWeaponModel.hasAutoEquipWing = true;
    //                 ItemOperateUtility.Instance.PutOnItem(item.guid);
    //                 return;
    //             }
    //         }
    //     }
    //     switch ((RoleEquipType)equipPlace)
    //     {
    //         case RoleEquipType.Weapon:
    //         case RoleEquipType.Weapon2:
    //         case RoleEquipType.Hat:
    //         case RoleEquipType.Clothes:
    //         case RoleEquipType.Belt:
    //         case RoleEquipType.Trousers:
    //         case RoleEquipType.Shoes:
    //         case RoleEquipType.Neck:
    //         case RoleEquipType.FairyCan1:
    //         case RoleEquipType.FairyCan2:
    //         case RoleEquipType.Glove:
    //         case RoleEquipType.Jade:
    //         case RoleEquipType.Wing:
    //         case RoleEquipType.Guard:
    //         case RoleEquipType.PeerlessWeapon1:
    //         case RoleEquipType.PeerlessWeapon2:
    //             if (betterEquipExceptDungeonDict.ContainsKey(PlayerDatas.Instance.baseData.MapID))
    //             {
    //                 if (betterEquipExceptDungeonDict[PlayerDatas.Instance.baseData.MapID].Contains(item.itemId))
    //                 {
    //                     return;
    //                 }
    //             }
    //             SetGetBetterEquipEvent(item);
    //             break;
    //     }
    // }
    private void SetGetBetterEquipEvent(ItemModel model)
    {
        // // if (model.isAuction)
        // // {
        // //    return;
        // // }
        // var itemEffectTime = model.GetUseData((int)ItemUseDataKey.createTime);
        // if (!itemEffectTime.IsNullOrEmpty() && itemEffectTime.Count > 0)
        // {
        //     if (itemEffectTime[0] != 0)
        //     {
        //         var cool = KnapsackTimeCDMgr.Instance.GetItemCoolById(model.guid);
        //         double remainTime = 0;
        //         if (cool != null)
        //         {
        //             remainTime = cool.GetRemainTime();
        //         }
        //         if (remainTime >= 0 && remainTime < 120 && model.config.ExpireTime > 0)
        //         {
        //             return;
        //         }
        //     }
        // }
        // if (!equipModel.IsLevelUnLocked(model.config.LV))
        // {
        //     return;
        // }
        // int isFightUp = IsFightUp(model.itemId, model.score);
        // if (isFightUp != 1)
        // {
        //     return;
        // }
        // if (GetBetterEquipEvent != null)
        // {
        //     GetBetterEquipEvent(model.guid);
        // }
    }
    Dictionary<int, ItemModel> RealmBetterDict = new Dictionary<int, ItemModel>();
    // public Dictionary<int, ItemModel> CheckBetterEquipByRealm()
    // {
    //     RealmBetterDict.Clear();
    //     SinglePack singlePack = packModel.GetSinglePack(PackType.Item);
    //     if (singlePack == null) return RealmBetterDict;
    //     int realmLv = PlayerDatas.Instance.baseData.realmLevel;
    //     Dictionary<int, ItemModel> pairs = singlePack.GetAllItems();
    //     foreach (var model in pairs.Values)
    //     {
    //         var equipServerIndex = EquipSet.ClientPlaceToServerPlace(new Int2(model.config.LV, model.config.EquipPlace));
    //         if (model.config.EquipPlace > 0
    //             && model.config.EquipPlace != (int)RoleEquipType.Guard
    //             && model.config.RealmLimit <= realmLv
    //             && !IsOverdue(model.guid)
    //             && IsFightUp(model.itemId, model.score) == 1)
    //         {
    //             if (!RealmBetterDict.ContainsKey(equipServerIndex))
    //             {
    //                 RealmBetterDict.Add(equipServerIndex, model);
    //             }
    //             else
    //             {
    //                 if (model.score > RealmBetterDict[equipServerIndex].score)
    //                 {
    //                     RealmBetterDict[equipServerIndex] = model;
    //                 }
    //             }
    //         }
    //     }
    //     return RealmBetterDict;
    // }
    // List<ItemModel> RealmDruglist = new List<ItemModel>();
    // public List<ItemModel> GetDruglistByRealm()
    // {
    //     RealmDruglist.Clear();
    //     SinglePack singlePack = packModel.GetSinglePack(PackType.Item);
    //     if (singlePack == null) return RealmDruglist;
    //     int realmLv = PlayerDatas.Instance.baseData.realmLevel;
    //     Dictionary<int, ItemModel> pairs = singlePack.GetAllItems();
    //     foreach (var model in pairs.Values)
    //     {
    //         if (packModel.CheckIsDrugById(model.itemId))
    //         {
    //             AttrFruitConfig fruitConfig = AttrFruitConfig.Get(model.itemId);
    //             if (!packModel.IsReachMaxUseDrug(fruitConfig)
    //                 && model.config.RealmLimit <= realmLv)
    //             {
    //                 RealmDruglist.Add(model);
    //             }
    //         }
    //     }
    //     return RealmDruglist;
    // }
    #region 物品处于CD中的逻辑处理
    private List<string> itemEffectTimelist = new List<string>(); //key 物品实例ID
    /// <summary>
    /// 物品使用时间限制
    /// </summary>
    public void SetItemEffectCDTime(string guid, int itemID, int getTime, int serverSurplusTime)
    {
        double time = GetTimeOffest(TimeUtility.GetTime((uint)getTime));
        if (time < 0)
        {
            time = 0;
        }
        ItemConfig itemConfig = ItemConfig.Get(itemID);
        if (time >= itemConfig.ExpireTime)
        {
            KnapsackTimeCDMgr.Instance.UnRegister(guid);
            return;
        }
        double remainTime = (serverSurplusTime > 0 ? serverSurplusTime : itemConfig.ExpireTime) - time;
        KnapsackTimeCDMgr.Instance.Register(guid, itemID, remainTime);
    }
    public double GetTimeOffest(DateTime getTime)
    {
        Debug.Log("现在时间:" + TimeUtility.ServerNow + "获得时间:" + getTime);
        //TimeUtility.SyncServerTime();
        TimeSpan t = TimeUtility.ServerNow - getTime;
        Debug.Log("时间差:" + t.TotalSeconds);
        return t.TotalSeconds;
    }
    #endregion
    #region 设置可以一键出售的物品数据
    private int playerLv;
    private Dictionary<int, List<ItemModel>> _lifePotionDict = new Dictionary<int, List<ItemModel>>(); //key 药水等级
    private List<int> _sellItemScorelist = new List<int>();
    private Dictionary<int, Dictionary<int, List<ItemModel>>> _sameIndexEquipDict = new Dictionary<int, Dictionary<int, List<ItemModel>>>();  //存储相同装备位的装备
                                                                                                                                              // private  _sameEquipScoreDict = new Dictionary<int, List<ItemModel>>(); //存储相同ID中相同装备评分的装备
    private Dictionary<int, ItemModel> _packModelDict;
    private List<ItemModel> _sellItemlist = new List<ItemModel>();
    // public List<ItemModel> GetSellItemList()
    // {
    //     GetOneKeySellModel();
    //     _sellItemlist.Sort(SetSellItemOrder);
    //     return _sellItemlist;
    // }
    // public int SetSellItemOrder(ItemModel startModel, ItemModel endModel)
    // {
    //     bool startIsEquip = IsRealmEquip(startModel.itemId);
    //     bool endIsEquip = IsRealmEquip(endModel.itemId);
    //     if (startIsEquip.CompareTo(endIsEquip) != 0) return -startIsEquip.CompareTo(endIsEquip);
    //     int order1 = startModel.config.Type;
    //     int order2 = endModel.config.Type;
    //     if (order1.CompareTo(order2) != 0) return order1.CompareTo(order2);
    //     int color1 = startModel.config.ItemColor;
    //     int color2 = endModel.config.ItemColor;
    //     if (color1.CompareTo(color2) != 0) return -color1.CompareTo(color2);
    //     int code1 = startModel.itemId;
    //     int code2 = endModel.itemId;
    //     if (code1.CompareTo(code2) != 0) return -code1.CompareTo(code2);
    //     return 0;
    // }
    // public void GetOneKeySellModel()
    // {
    //     SinglePack singlePack = packModel.GetSinglePack(PackType.Item);
    //     if (singlePack == null)
    //         return;
    //     _sellItemlist.Clear();
    //     _lifePotionDict.Clear();
    //     _sameIndexEquipDict.Clear();
    //     _sellItemScorelist.Clear();
    //     playerLv = PlayerDatas.Instance.baseData.LV;
    //     _packModelDict = singlePack.GetAllItems();
    //     foreach (var key in _packModelDict.Keys)
    //     {
    //         GetCanSellEquipList(_packModelDict[key]);
    //         ItemModel itemModel = _packModelDict[key];
    //         if (drugIDs.Contains(itemModel.itemId))
    //         {
    //             if (!_lifePotionDict.ContainsKey(itemModel.config.LV))
    //             {
    //                 List<ItemModel> modellist = new List<ItemModel>();
    //                 modellist.Add(itemModel);
    //                 _lifePotionDict.Add(itemModel.config.LV, modellist);
    //             }
    //             else
    //             {
    //                 _lifePotionDict[itemModel.config.LV].Add(itemModel);
    //             }
    //         }
    //     }
    //     #region 得到可以出售的装备
    //     foreach (var key in _sameIndexEquipDict.Keys)
    //     {
    //         _sellItemScorelist = _sameIndexEquipDict[key].Keys.ToList();
    //         _sellItemScorelist.Sort();
    //         if (_sellItemScorelist.Count > 0)
    //         {
    //             int score = 0;
    //             for (score = _sellItemScorelist.Count - 1; score > -1; score--)
    //             {
    //                 SinglePack equipPack = packModel.GetSinglePack(PackType.Equip);
    //                 ItemModel model = null;
    //                 if (equipPack != null)
    //                 {
    //                     model = equipPack.GetItemByIndex(key);
    //                 }
    //                 var modellist = _sameIndexEquipDict[key][_sellItemScorelist[score]];
    //                 bool remainBetter = true;
    //                 for (var i = 0; i < modellist.Count; i++)
    //                 {
    //                     if (model != null)
    //                     {
    //                         if (remainBetter)
    //                         {
    //                             if (model.score < _sellItemScorelist[score] && IsJobCompatibleItem(model.itemId))
    //                             {
    //                                 _sameIndexEquipDict[key].Remove(_sellItemScorelist[score]);
    //                                 remainBetter = false;
    //                                 break;
    //                             }
    //                         }
    //                     }
    //                     else
    //                     {
    //                         if (IsJobCompatibleItem(model.itemId))
    //                         {
    //                             if (remainBetter)
    //                             {
    //                                 _sameIndexEquipDict[key].Remove(_sellItemScorelist[score]);
    //                                 remainBetter = false;
    //                                 break;
    //                             }
    //                         }
    //                     }
    //                 }
    //                 if (!remainBetter)
    //                 {
    //                     break;
    //                 }
    //             }
    //             for (var j = 0; j < _sellItemScorelist.Count; j++)
    //             {
    //                 if (_sameIndexEquipDict[key].ContainsKey(_sellItemScorelist[j]))
    //                 {
    //                     var sellModlelist = _sameIndexEquipDict[key][_sellItemScorelist[j]];
    //                     for (var k = 0; k < sellModlelist.Count; k++)
    //                     {
    //                         _sellItemlist.Add(sellModlelist[k]);
    //                     }
    //                 }
    //             }
    //         }
    //     }
    //     #endregion
    //     List<int> drugLvlist = new List<int>();
    //     drugLvlist.AddRange(_lifePotionDict.Keys.ToList());
    //     drugLvlist.Sort();
    //     for (int i = drugLvlist.Count - 1; i > -1; i--)
    //     {
    //         if (drugLvlist[i] > playerLv)
    //         {
    //             _lifePotionDict.Remove(drugLvlist[i]);
    //         }
    //         else
    //         {
    //             _lifePotionDict.Remove(drugLvlist[i]);
    //             break;
    //         }
    //     }
    //     foreach (var list in _lifePotionDict.Values)
    //     {
    //         for (int i = 0; i < list.Count; i++)
    //         {
    //             _sellItemlist.Add(list[i]);
    //         }
    //     }
    // }
    //得到满足出售条件的装备列表
    // public void GetCanSellEquipList(ItemModel model)
    // {
    //     if (model.config.EquipPlace == 0 || !onekeySellTypes.Contains(model.config.Type))
    //         return;
    //     Dictionary<int, List<ItemModel>> sameScoreDict;
    //     List<ItemModel> sameScorelist;
    //     if (model.config.ItemColor < 3)
    //     {
    //         if (!_sameIndexEquipDict.ContainsKey(model.config.EquipPlace))
    //         {
    //             sameScoreDict = new Dictionary<int, List<ItemModel>>();
    //             sameScorelist = new List<ItemModel>();
    //             sameScorelist.Add(model);
    //             sameScoreDict.Add(model.score, sameScorelist);
    //             _sameIndexEquipDict.Add(model.config.EquipPlace, sameScoreDict);
    //         }
    //         else
    //         {
    //             if (_sameIndexEquipDict[model.config.EquipPlace].ContainsKey(model.score))
    //             {
    //                 _sameIndexEquipDict[model.config.EquipPlace][model.score].Add(model);
    //             }
    //             else
    //             {
    //                 sameScorelist = new List<ItemModel>();
    //                 sameScorelist.Add(model);
    //                 _sameIndexEquipDict[model.config.EquipPlace].Add(model.score, sameScorelist);
    //             }
    //         }
    //     }
    // }
    #endregion
    #region 发送请求
    /// <summary>
    /// 一键出售物品的请求
    /// </summary>
    /// <param name="_oneKeySelllist"></param>
    // public void OneKeySell(List<ItemModel> _oneKeySelllist)
    // {
    //     if (!isPackResetOk || SettingEffectMgr.Instance.isStartOneKeySell) return;
    //     SettingEffectMgr.Instance.isStartOneKeySell = true;
    //     byte[] itemIndexs = new byte[_oneKeySelllist.Count];
    //     int i = 0;
    //     for (i = 0; i < _oneKeySelllist.Count; i++)
    //     {
    //         itemIndexs[i] = (byte)_oneKeySelllist[i].gridIndex;
    //     }
    //     CA311_tagCMSellItem sellItem = new CA311_tagCMSellItem();
    //     sellItem.PackType = (int)PackType.Item;
    //     sellItem.Count = (byte)_oneKeySelllist.Count;
    //     sellItem.ItemIndex = itemIndexs;
    //     GameNetSystem.Instance.SendInfo(sellItem);
    // }
    /// <summary>
    /// 整理包裹物品
    /// </summary>
    /// <param name="type"></param>
    public bool isPackResetOk { get; set; }
    public void ResetPack(PackType type)
    {
        if (lookLineIndex > -1)
        {
            SetLookIndex(null);
        }
        SinglePack singlePack = packModel.GetSinglePack(type);
        if (singlePack != null)
        {
            var packReset = new C070F_tagCItemPackReset();
            packReset.Type = (byte)type;
            packReset.ItemBeginIndex = 0;
            packReset.ItemEndIndex = (ushort)(singlePack.unlockedGridCount - 1);
            GameNetSystem.Instance.SendInfo(packReset); //整理物品
            if (type == PackType.Item)
            {
                isPackResetOk = false;
            }
        }
    }
    #endregion
    #region 查看某个位置的物品
    public event Action lookEquipEvent;
    private int _lookLineIndex = -1;
    public int lookLineIndex { get { return _lookLineIndex; } private set { _lookLineIndex = value; } }
    public string lookItemGUID { get; private set; }
    public void SetLookIndex(string guid, int singleRowCount = 5)
    {
        if (string.IsNullOrEmpty(guid) || guid == "")
        {
            lookLineIndex = -1;
        }
        else
        {
            int index = packModel.GetItemByGuid(guid).gridIndex;
            lookLineIndex = index / singleRowCount;
            lookItemGUID = guid;
        }
        if (lookEquipEvent != null)
        {
            lookEquipEvent();
        }
    }
    #endregion
    #region 判断是否有更好的装备替换
    /// <summary>
    /// 获取装备评分最高可提升战力的装备
    /// </summary>
    /// <param name="_places"></param>
    /// <returns></returns>
    // public string GetHighestScoreEquipByPlace(int equipPlace)
    // {
    //     var itemPackage = packModel.GetSinglePack(PackType.Item);
    //     var allItems = itemPackage.GetAllItems();
    //     var putModel = packModel.GetItemByIndex(PackType.Equip, equipPlace);
    //     var guid = string.Empty;
    //     var score = putModel == null ? 0 : putModel.score;
    //     foreach (var item in allItems.Values)
    //     {
    //         if (item.config.EquipPlace == equipPlace)
    //         {
    //             if (!IsOverdue(item.guid)
    //                && (IsJobCompatibleItem(item.itemId)) && item.score > score)
    //             {
    //                 guid = item.guid;
    //                 score = item.score;
    //             }
    //         }
    //     }
    //     return guid;
    // }
    #endregion
    #region 背包整理后好的同类型最好的装备
    Dictionary<int, Dictionary<int, ItemModel>> itemModelDict = new Dictionary<int, Dictionary<int, ItemModel>>();  // key1 装备位置索引 key2 背包位置索引
    public void ClearSortedBetterEquip()
    {
        itemModelDict.Clear();
    }
    public void SetBagSortBetterEquipList(ItemModel itemModel)
    {
        if (itemModel == null || itemModel.packType != PackType.Item) return;
        if (!IsCanPutOn(itemModel)) return;
        int equipPlace = itemModel.config.EquipPlace;
        if (!itemModelDict.ContainsKey(equipPlace))
        {
            var dict = new Dictionary<int, ItemModel>();
            if (IsFightUp(itemModel.itemId, itemModel.score) == 1)
            {
                dict.Add(itemModel.gridIndex, itemModel);
                itemModelDict.Add(equipPlace, dict);
            }
        }
        else
        {
            if (IsFightUp(itemModel.itemId, itemModel.score) == 1)
            {
                itemModelDict[equipPlace].Add(itemModel.gridIndex, itemModel);
            }
        }
    }
    public ItemModel GetBagSortBetterEquip(int equipPlace, int index)
    {
        ItemModel itemModel = null;
        if (itemModelDict.ContainsKey(equipPlace))
        {
            itemModelDict[equipPlace].TryGetValue(index, out itemModel);
        }
        return itemModel;
    }
    bool IsCanPutOn(ItemModel item)
    {
        if (IsJobCompatibleItem(item.itemId))
        {
            return false;
        }
        int equipPlace = item.config.EquipPlace;
        if (equipPlace == 0 || equipPlace > 17)
        {
            return false;
        }
        var putOnlimitList = item.GetUseData((int)ItemUseDataKey.cancelUseLimit);
        if (!putOnlimitList.IsNullOrEmpty())
        {
            if (putOnlimitList[0] == 1)
            {
                return true;
            }
            else
            {
                return false;
            }
        }
        public event Action<string> GetBetterEquipEvent; //得到更好的装备 value 物品的实例ID
        return true;
    }
        // public void OnGetEquip(ItemModel item)
    #endregion
    #region 得到物品的品质颜色
    private Dictionary<int, int> wingRefineQualityDict;
    private int[] wingsQualitys;
    private int[] wingsRefineExps;
    public int GetItemQuality(int itemId, Dictionary<int, List<int>> useDataDic = null)
    {
        wingsQualitys = null;
        wingsRefineExps = null;
        ItemConfig itemConfig = ItemConfig.Get(itemId);
        // wingRefineQualityDict = WingRefineAttrConfig.GetWingsQualityModel(itemConfig.LV);
        // if (useDataDic != null)
        // {
        //     if (item == null)
        //     if (useDataDic.ContainsKey(42) && wingRefineQualityDict != null)
        //     {
        //         return;
        //     }
        //     if (item.packType != PackType.Item)
        //     {
        //         return;
        //     }
        //     if (!IsJobCompatibleItem(item.itemId))
        //     {
        //         return;
        //     }
        //     int equipPlace = item.config.EquipPlace;
        //     if ((RoleEquipType)equipPlace == RoleEquipType.Wing)
        //     {
        //         var wing = packModel.GetItemByIndex(PackType.Equip, SpiritWeaponModel.WING_EQUIPINDEX);
        //         if (wing == null)
        //         wingsQualitys = wingRefineQualityDict.Keys.ToArray();
        //         wingsRefineExps = wingRefineQualityDict.Values.ToArray();
        //         int i = 0;
        //         for (i = wingsRefineExps.Length - 1; i > -1; i--)
        //         {
        //             if (!SpiritWeaponModel.hasAutoEquipWing)
        //             if (useDataDic[42][0] >= wingsRefineExps[i])
        //             {
        //                 SpiritWeaponModel.hasAutoEquipWing = true;
        //                 ItemOperateUtility.Instance.PutOnItem(item.guid);
        //                 return;
        //                 return wingsQualitys[i];
        //             }
        //         }
        //     }
        //     switch ((RoleEquipType)equipPlace)
        //     {
        //         case RoleEquipType.Weapon:
        //         case RoleEquipType.Weapon2:
        //         case RoleEquipType.Hat:
        //         case RoleEquipType.Clothes:
        //         case RoleEquipType.Belt:
        //         case RoleEquipType.Trousers:
        //         case RoleEquipType.Shoes:
        //         case RoleEquipType.Neck:
        //         case RoleEquipType.FairyCan1:
        //         case RoleEquipType.FairyCan2:
        //         case RoleEquipType.Glove:
        //         case RoleEquipType.Jade:
        //         case RoleEquipType.Wing:
        //         case RoleEquipType.Guard:
        //         case RoleEquipType.PeerlessWeapon1:
        //         case RoleEquipType.PeerlessWeapon2:
        //             if (betterEquipExceptDungeonDict.ContainsKey(PlayerDatas.Instance.baseData.MapID))
        //             {
        //                 if (betterEquipExceptDungeonDict[PlayerDatas.Instance.baseData.MapID].Contains(item.itemId))
        //                 {
        //                     return;
        //                 }
        //             }
        //             SetGetBetterEquipEvent(item);
        //             break;
        //     }
        // }
        return itemConfig.ItemColor;
    }
    #endregion
        private void SetGetBetterEquipEvent(ItemModel model)
    //设置玩家货币显示
    public string OnChangeCoinsUnit(ulong value)
    {
        return UIHelper.ReplaceLargeNum(value);
    }
    /// <summary>
    /// 装备是否可以提升战力
    /// </summary>
    /// <param name="_itemID"></param>
    /// <param name="_score"></param>
    /// <returns></returns>
    public int IsFightUp(int _itemID, int _score)//-1低级,0不是本职业,1更好
    {
        var config = ItemConfig.Get(_itemID);
        if (config != null)
        {
            // // if (model.isAuction)
            // // {
            // //    return;
            // // }
            // var itemEffectTime = model.GetUseData((int)ItemUseDataKey.createTime);
            // if (!itemEffectTime.IsNullOrEmpty() && itemEffectTime.Count > 0)
            // var index = EquipModel.GetItemServerEquipPlace(_itemID);
            // if (index == -1)
            // {
            //     if (itemEffectTime[0] != 0)
            //     {
            //         var cool = KnapsackTimeCDMgr.Instance.GetItemCoolById(model.guid);
            //         double remainTime = 0;
            //         if (cool != null)
            //         {
            //             remainTime = cool.GetRemainTime();
            //         }
            //         if (remainTime >= 0 && remainTime < 120 && model.config.ExpireTime > 0)
            //         {
            //             return;
            //         }
            //     }
            //     return 0;
            // }
            // if (!equipModel.IsLevelUnLocked(model.config.LV))
            // var item = packModel.GetItemByIndex(PackType.Equip, index);
            // var equipScore = item != null ? item.score : 0;
            // if (IsJobCompatibleItem(_itemID))
            // {
            //     return;
            //     return _score.CompareTo(equipScore);
            // }
            // int isFightUp = IsFightUp(model.itemId, model.score);
            // if (isFightUp != 1)
            // else
            // {
            //     return;
            // }
            // if (GetBetterEquipEvent != null)
            // {
            //     GetBetterEquipEvent(model.guid);
            //     return 0;
            // }
        }
        return 0;
    }
        Dictionary<int, ItemModel> RealmBetterDict = new Dictionary<int, ItemModel>();
        // public Dictionary<int, ItemModel> CheckBetterEquipByRealm()
        // {
        //     RealmBetterDict.Clear();
        //     SinglePack singlePack = packModel.GetSinglePack(PackType.Item);
        //     if (singlePack == null) return RealmBetterDict;
        //     int realmLv = PlayerDatas.Instance.baseData.realmLevel;
        //     Dictionary<int, ItemModel> pairs = singlePack.GetAllItems();
        //     foreach (var model in pairs.Values)
        //     {
        //         var equipServerIndex = EquipSet.ClientPlaceToServerPlace(new Int2(model.config.LV, model.config.EquipPlace));
        //         if (model.config.EquipPlace > 0
        //             && model.config.EquipPlace != (int)RoleEquipType.Guard
        //             && model.config.RealmLimit <= realmLv
        //             && !IsOverdue(model.guid)
        //             && IsFightUp(model.itemId, model.score) == 1)
        //         {
        //             if (!RealmBetterDict.ContainsKey(equipServerIndex))
        //             {
        //                 RealmBetterDict.Add(equipServerIndex, model);
        //             }
        //             else
        //             {
        //                 if (model.score > RealmBetterDict[equipServerIndex].score)
        //                 {
        //                     RealmBetterDict[equipServerIndex] = model;
        //                 }
        //             }
        //         }
        //     }
        //     return RealmBetterDict;
        // }
        // List<ItemModel> RealmDruglist = new List<ItemModel>();
        // public List<ItemModel> GetDruglistByRealm()
        // {
        //     RealmDruglist.Clear();
        //     SinglePack singlePack = packModel.GetSinglePack(PackType.Item);
        //     if (singlePack == null) return RealmDruglist;
        //     int realmLv = PlayerDatas.Instance.baseData.realmLevel;
        //     Dictionary<int, ItemModel> pairs = singlePack.GetAllItems();
        //     foreach (var model in pairs.Values)
        //     {
        //         if (packModel.CheckIsDrugById(model.itemId))
        //         {
        //             AttrFruitConfig fruitConfig = AttrFruitConfig.Get(model.itemId);
        //             if (!packModel.IsReachMaxUseDrug(fruitConfig)
        //                 && model.config.RealmLimit <= realmLv)
        //             {
        //                 RealmDruglist.Add(model);
        //             }
        //         }
        //     }
        //     return RealmDruglist;
        // }
        #region 物品处于CD中的逻辑处理
        private List<string> itemEffectTimelist = new List<string>(); //key 物品实例ID
        /// <summary>
        /// 物品使用时间限制
        /// </summary>
        public void SetItemEffectCDTime(string guid, int itemID, int getTime, int serverSurplusTime)
    // 不包含未开放装备的比较 属于-1
    public int IsFightUpEx(int _itemID, int _score, int _realm)//-1低级,0不是本职业,1更好
    {
        var config = ItemConfig.Get(_itemID);
        if (config != null)
        {
            double time = GetTimeOffest(TimeUtility.GetTime((uint)getTime));
            if (time < 0)
            {
                time = 0;
            }
            ItemConfig itemConfig = ItemConfig.Get(itemID);
            if (time >= itemConfig.ExpireTime)
            {
                KnapsackTimeCDMgr.Instance.UnRegister(guid);
                return;
            }
            double remainTime = (serverSurplusTime > 0 ? serverSurplusTime : itemConfig.ExpireTime) - time;
            KnapsackTimeCDMgr.Instance.Register(guid, itemID, remainTime);
        }
        public double GetTimeOffest(DateTime getTime)
        {
            Debug.Log("现在时间:" + TimeUtility.ServerNow + "获得时间:" + getTime);
            //TimeUtility.SyncServerTime();
            TimeSpan t = TimeUtility.ServerNow - getTime;
            Debug.Log("时间差:" + t.TotalSeconds);
            return t.TotalSeconds;
        }
        #endregion
        #region 设置可以一键出售的物品数据
        private int playerLv;
        private Dictionary<int, List<ItemModel>> _lifePotionDict = new Dictionary<int, List<ItemModel>>(); //key 药水等级
        private List<int> _sellItemScorelist = new List<int>();
        private Dictionary<int, Dictionary<int, List<ItemModel>>> _sameIndexEquipDict = new Dictionary<int, Dictionary<int, List<ItemModel>>>();  //存储相同装备位的装备
                                                                                                                                                  // private  _sameEquipScoreDict = new Dictionary<int, List<ItemModel>>(); //存储相同ID中相同装备评分的装备
        private Dictionary<int, ItemModel> _packModelDict;
        private List<ItemModel> _sellItemlist = new List<ItemModel>();
        // public List<ItemModel> GetSellItemList()
        // {
        //     GetOneKeySellModel();
        //     _sellItemlist.Sort(SetSellItemOrder);
        //     return _sellItemlist;
        // }
        // public int SetSellItemOrder(ItemModel startModel, ItemModel endModel)
        // {
        //     bool startIsEquip = IsRealmEquip(startModel.itemId);
        //     bool endIsEquip = IsRealmEquip(endModel.itemId);
        //     if (startIsEquip.CompareTo(endIsEquip) != 0) return -startIsEquip.CompareTo(endIsEquip);
        //     int order1 = startModel.config.Type;
        //     int order2 = endModel.config.Type;
        //     if (order1.CompareTo(order2) != 0) return order1.CompareTo(order2);
        //     int color1 = startModel.config.ItemColor;
        //     int color2 = endModel.config.ItemColor;
        //     if (color1.CompareTo(color2) != 0) return -color1.CompareTo(color2);
        //     int code1 = startModel.itemId;
        //     int code2 = endModel.itemId;
        //     if (code1.CompareTo(code2) != 0) return -code1.CompareTo(code2);
        //     return 0;
        // }
        // public void GetOneKeySellModel()
        // {
        //     SinglePack singlePack = packModel.GetSinglePack(PackType.Item);
        //     if (singlePack == null)
        //         return;
        //     _sellItemlist.Clear();
        //     _lifePotionDict.Clear();
        //     _sameIndexEquipDict.Clear();
        //     _sellItemScorelist.Clear();
        //     playerLv = PlayerDatas.Instance.baseData.LV;
        //     _packModelDict = singlePack.GetAllItems();
        //     foreach (var key in _packModelDict.Keys)
        //     {
        //         GetCanSellEquipList(_packModelDict[key]);
        //         ItemModel itemModel = _packModelDict[key];
        //         if (drugIDs.Contains(itemModel.itemId))
        //         {
        //             if (!_lifePotionDict.ContainsKey(itemModel.config.LV))
        //             {
        //                 List<ItemModel> modellist = new List<ItemModel>();
        //                 modellist.Add(itemModel);
        //                 _lifePotionDict.Add(itemModel.config.LV, modellist);
        //             }
        //             else
        //             {
        //                 _lifePotionDict[itemModel.config.LV].Add(itemModel);
        //             }
        //         }
        //     }
        //     #region 得到可以出售的装备
        //     foreach (var key in _sameIndexEquipDict.Keys)
        //     {
        //         _sellItemScorelist = _sameIndexEquipDict[key].Keys.ToList();
        //         _sellItemScorelist.Sort();
        //         if (_sellItemScorelist.Count > 0)
        //         {
        //             int score = 0;
        //             for (score = _sellItemScorelist.Count - 1; score > -1; score--)
        //             {
        //                 SinglePack equipPack = packModel.GetSinglePack(PackType.Equip);
        //                 ItemModel model = null;
        //                 if (equipPack != null)
        //                 {
        //                     model = equipPack.GetItemByIndex(key);
        //                 }
        //                 var modellist = _sameIndexEquipDict[key][_sellItemScorelist[score]];
        //                 bool remainBetter = true;
        //                 for (var i = 0; i < modellist.Count; i++)
        //                 {
        //                     if (model != null)
        //                     {
        //                         if (remainBetter)
        //                         {
        //                             if (model.score < _sellItemScorelist[score] && IsJobCompatibleItem(model.itemId))
        //                             {
        //                                 _sameIndexEquipDict[key].Remove(_sellItemScorelist[score]);
        //                                 remainBetter = false;
        //                                 break;
        //                             }
        //                         }
        //                     }
        //                     else
        //                     {
        //                         if (IsJobCompatibleItem(model.itemId))
        //                         {
        //                             if (remainBetter)
        //                             {
        //                                 _sameIndexEquipDict[key].Remove(_sellItemScorelist[score]);
        //                                 remainBetter = false;
        //                                 break;
        //                             }
        //                         }
        //                     }
        //                 }
        //                 if (!remainBetter)
        //                 {
        //                     break;
        //                 }
        //             }
        //             for (var j = 0; j < _sellItemScorelist.Count; j++)
        //             {
        //                 if (_sameIndexEquipDict[key].ContainsKey(_sellItemScorelist[j]))
        //                 {
        //                     var sellModlelist = _sameIndexEquipDict[key][_sellItemScorelist[j]];
        //                     for (var k = 0; k < sellModlelist.Count; k++)
        //                     {
        //                         _sellItemlist.Add(sellModlelist[k]);
        //                     }
        //                 }
        //             }
        //         }
        //     }
        //     #endregion
        //     List<int> drugLvlist = new List<int>();
        //     drugLvlist.AddRange(_lifePotionDict.Keys.ToList());
        //     drugLvlist.Sort();
        //     for (int i = drugLvlist.Count - 1; i > -1; i--)
        //     {
        //         if (drugLvlist[i] > playerLv)
        //         {
        //             _lifePotionDict.Remove(drugLvlist[i]);
        //         }
        //         else
        //         {
        //             _lifePotionDict.Remove(drugLvlist[i]);
        //             break;
        //         }
        //     }
        //     foreach (var list in _lifePotionDict.Values)
        //     {
        //         for (int i = 0; i < list.Count; i++)
        //         {
        //             _sellItemlist.Add(list[i]);
        //         }
        //     }
        // }
        //得到满足出售条件的装备列表
        // public void GetCanSellEquipList(ItemModel model)
        // {
        //     if (model.config.EquipPlace == 0 || !onekeySellTypes.Contains(model.config.Type))
        //         return;
        //     Dictionary<int, List<ItemModel>> sameScoreDict;
        //     List<ItemModel> sameScorelist;
        //     if (model.config.ItemColor < 3)
        //     {
        //         if (!_sameIndexEquipDict.ContainsKey(model.config.EquipPlace))
        //         {
        //             sameScoreDict = new Dictionary<int, List<ItemModel>>();
        //             sameScorelist = new List<ItemModel>();
        //             sameScorelist.Add(model);
        //             sameScoreDict.Add(model.score, sameScorelist);
        //             _sameIndexEquipDict.Add(model.config.EquipPlace, sameScoreDict);
        //         }
        //         else
        //         {
        //             if (_sameIndexEquipDict[model.config.EquipPlace].ContainsKey(model.score))
        //             {
        //                 _sameIndexEquipDict[model.config.EquipPlace][model.score].Add(model);
        //             }
        //             else
        //             {
        //                 sameScorelist = new List<ItemModel>();
        //                 sameScorelist.Add(model);
        //                 _sameIndexEquipDict[model.config.EquipPlace].Add(model.score, sameScorelist);
        //             }
        //         }
        //     }
        // }
        #endregion
        #region 发送请求
        /// <summary>
        /// 一键出售物品的请求
        /// </summary>
        /// <param name="_oneKeySelllist"></param>
        // public void OneKeySell(List<ItemModel> _oneKeySelllist)
        // {
        //     if (!isPackResetOk || SettingEffectMgr.Instance.isStartOneKeySell) return;
        //     SettingEffectMgr.Instance.isStartOneKeySell = true;
        //     byte[] itemIndexs = new byte[_oneKeySelllist.Count];
        //     int i = 0;
        //     for (i = 0; i < _oneKeySelllist.Count; i++)
        //     {
        //         itemIndexs[i] = (byte)_oneKeySelllist[i].gridIndex;
        //     }
        //     CA311_tagCMSellItem sellItem = new CA311_tagCMSellItem();
        //     sellItem.PackType = (int)PackType.Item;
        //     sellItem.Count = (byte)_oneKeySelllist.Count;
        //     sellItem.ItemIndex = itemIndexs;
        //     GameNetSystem.Instance.SendInfo(sellItem);
        // }
        /// <summary>
        /// 整理包裹物品
        /// </summary>
        /// <param name="type"></param>
        public bool isPackResetOk { get; set; }
        public void ResetPack(PackType type)
        {
            if (lookLineIndex > -1)
            {
                SetLookIndex(null);
            }
            SinglePack singlePack = packModel.GetSinglePack(type);
            if (singlePack != null)
            {
                var packReset = new C070F_tagCItemPackReset();
                packReset.Type = (byte)type;
                packReset.ItemBeginIndex = 0;
                packReset.ItemEndIndex = (ushort)(singlePack.unlockedGridCount - 1);
                GameNetSystem.Instance.SendInfo(packReset); //整理物品
                if (type == PackType.Item)
                {
                    isPackResetOk = false;
                }
            }
        }
        #endregion
        #region 查看某个位置的物品
        public event Action lookEquipEvent;
        private int _lookLineIndex = -1;
        public int lookLineIndex { get { return _lookLineIndex; } private set { _lookLineIndex = value; } }
        public string lookItemGUID { get; private set; }
        public void SetLookIndex(string guid, int singleRowCount = 5)
        {
            if (string.IsNullOrEmpty(guid) || guid == "")
            {
                lookLineIndex = -1;
            }
            else
            {
                int index = packModel.GetItemByGuid(guid).gridIndex;
                lookLineIndex = index / singleRowCount;
                lookItemGUID = guid;
            }
            if (lookEquipEvent != null)
            {
                lookEquipEvent();
            }
        }
        #endregion
        #region 判断是否有更好的装备替换
        /// <summary>
        /// 获取装备评分最高可提升战力的装备
        /// </summary>
        /// <param name="_places"></param>
        /// <returns></returns>
        // public string GetHighestScoreEquipByPlace(int equipPlace)
        // {
        //     var itemPackage = packModel.GetSinglePack(PackType.Item);
        //     var allItems = itemPackage.GetAllItems();
        //     var putModel = packModel.GetItemByIndex(PackType.Equip, equipPlace);
        //     var guid = string.Empty;
        //     var score = putModel == null ? 0 : putModel.score;
        //     foreach (var item in allItems.Values)
        //     {
        //         if (item.config.EquipPlace == equipPlace)
        //         {
        //             if (!IsOverdue(item.guid)
        //                && (IsJobCompatibleItem(item.itemId)) && item.score > score)
        //             {
        //                 guid = item.guid;
        //                 score = item.score;
        //             }
        //         }
        //     }
        //     return guid;
        // }
        #endregion
        #region 背包整理后好的同类型最好的装备
        Dictionary<int, Dictionary<int, ItemModel>> itemModelDict = new Dictionary<int, Dictionary<int, ItemModel>>();  // key1 装备位置索引 key2 背包位置索引
        public void ClearSortedBetterEquip()
        {
            itemModelDict.Clear();
        }
        public void SetBagSortBetterEquipList(ItemModel itemModel)
        {
            if (itemModel == null || itemModel.packType != PackType.Item) return;
            if (!IsCanPutOn(itemModel)) return;
            int equipPlace = itemModel.config.EquipPlace;
            if (!itemModelDict.ContainsKey(equipPlace))
            {
                var dict = new Dictionary<int, ItemModel>();
                if (IsFightUp(itemModel.itemId, itemModel.score) == 1)
                {
                    dict.Add(itemModel.gridIndex, itemModel);
                    itemModelDict.Add(equipPlace, dict);
                }
            }
            else
            {
                if (IsFightUp(itemModel.itemId, itemModel.score) == 1)
                {
                    itemModelDict[equipPlace].Add(itemModel.gridIndex, itemModel);
                }
            }
        }
        public ItemModel GetBagSortBetterEquip(int equipPlace, int index)
        {
            ItemModel itemModel = null;
            if (itemModelDict.ContainsKey(equipPlace))
            {
                itemModelDict[equipPlace].TryGetValue(index, out itemModel);
            }
            return itemModel;
        }
        bool IsCanPutOn(ItemModel item)
        {
            if (IsJobCompatibleItem(item.itemId))
            {
                return false;
            }
            int equipPlace = item.config.EquipPlace;
            if (equipPlace == 0 || equipPlace > 17)
            {
                return false;
            }
            var putOnlimitList = item.GetUseData((int)ItemUseDataKey.cancelUseLimit);
            if (!putOnlimitList.IsNullOrEmpty())
            {
                if (putOnlimitList[0] == 1)
                {
                    return true;
                }
            }
            return PlayerDatas.Instance.baseData.realmLevel >= item.config.RealmLimit;
        }
        #endregion
        #region 得到物品的品质颜色
        private Dictionary<int, int> wingRefineQualityDict;
        private int[] wingsQualitys;
        private int[] wingsRefineExps;
        public int GetItemQuality(int itemId, Dictionary<int, List<int>> useDataDic = null)
        {
            wingsQualitys = null;
            wingsRefineExps = null;
            ItemConfig itemConfig = ItemConfig.Get(itemId);
            // wingRefineQualityDict = WingRefineAttrConfig.GetWingsQualityModel(itemConfig.LV);
            // if (useDataDic != null)
            // var index = EquipModel.GetItemServerEquipPlace(_itemID);
            // if (index == -1)
            // {
            //     if (useDataDic.ContainsKey(42) && wingRefineQualityDict != null)
            //     {
            //         wingsQualitys = wingRefineQualityDict.Keys.ToArray();
            //         wingsRefineExps = wingRefineQualityDict.Values.ToArray();
            //         int i = 0;
            //         for (i = wingsRefineExps.Length - 1; i > -1; i--)
            //         {
            //             if (useDataDic[42][0] >= wingsRefineExps[i])
            //             {
            //                 return wingsQualitys[i];
            //             }
            //         }
            //     }
            //     return 0;
            // }
            return itemConfig.ItemColor;
        }
        #endregion
        //设置玩家货币显示
        public string OnChangeCoinsUnit(ulong value)
        {
            return UIHelper.ReplaceLargeNum(value);
            // var item = packModel.GetItemByIndex(PackType.Equip, index);
            // var equipScore = item != null ? item.score : 0;
            // if (IsJobCompatibleItem(_itemID))
            // {
            //     if (_realm > PlayerDatas.Instance.baseData.realmLevel)
            //         return -1;
            //     return _score.CompareTo(equipScore);
            // }
            // else
            // {
            //     return 0;
            // }
        }
        /// <summary>
        /// 装备是否可以提升战力
        /// </summary>
        /// <param name="_itemID"></param>
        /// <param name="_score"></param>
        /// <returns></returns>
        public int IsFightUp(int _itemID, int _score)//-1低级,0不是本职业,1更好
        return 0;
    }
    #region 物品是否过期
    public bool IsOverdue(string guid)
    {
        var item = packModel.GetItemByGuid(guid);
        if (item == null)
        {
            var config = ItemConfig.Get(_itemID);
            if (config != null)
            {
                // var index = EquipModel.GetItemServerEquipPlace(_itemID);
                // if (index == -1)
                // {
                //     return 0;
                // }
                // var item = packModel.GetItemByIndex(PackType.Equip, index);
                // var equipScore = item != null ? item.score : 0;
                // if (IsJobCompatibleItem(_itemID))
                // {
                //     return _score.CompareTo(equipScore);
                // }
                // else
                // {
                //     return 0;
                // }
            }
            return 0;
            return false;
        }
        // 不包含未开放装备的比较 属于-1
        public int IsFightUpEx(int _itemID, int _score, int _realm)//-1低级,0不是本职业,1更好
        if (item.isAuction)
        {
            var config = ItemConfig.Get(_itemID);
            if (config != null)
            {
                // var index = EquipModel.GetItemServerEquipPlace(_itemID);
                // if (index == -1)
                // {
                //     return 0;
                // }
                // var item = packModel.GetItemByIndex(PackType.Equip, index);
                // var equipScore = item != null ? item.score : 0;
                // if (IsJobCompatibleItem(_itemID))
                // {
                //     if (_realm > PlayerDatas.Instance.baseData.realmLevel)
                //         return -1;
                //     return _score.CompareTo(equipScore);
                // }
                // else
                // {
                //     return 0;
                // }
            }
            return 0;
            return false;//item.auctionSurplusTime < 0;
        }
        #region 物品是否过期
        public bool IsOverdue(string guid)
        else
        {
            var item = packModel.GetItemByGuid(guid);
            if (item == null)
            var isoverdue = false;
            switch ((ItemTimeType)item.config.EndureReduceType)
            {
                return false;
                case ItemTimeType.EquipedTime:
                    isoverdue = item.GetUseDataFirstValue(44) > 0 && item.overdueSurplusTime < 0;
                    break;
                case ItemTimeType.RealityTime:
                    isoverdue = item.overdueSurplusTime < 0;
                    break;
            }
            if (item.isAuction)
            {
                return false;//item.auctionSurplusTime < 0;
            }
            else
            {
                var isoverdue = false;
                switch ((ItemTimeType)item.config.EndureReduceType)
                {
                    case ItemTimeType.EquipedTime:
                        isoverdue = item.GetUseDataFirstValue(44) > 0 && item.overdueSurplusTime < 0;
                        break;
                    case ItemTimeType.RealityTime:
                        isoverdue = item.overdueSurplusTime < 0;
                        break;
                }
                return isoverdue;
            }
        }
        #endregion
        public bool IsJobCompatibleItem(int itemId)
        {
            var config = ItemConfig.Get(itemId);
            return config != null && (config.JobLimit == 0 || config.JobLimit == PlayerDatas.Instance.baseData.Job);
        }
        public bool IsRealmEquip(int itemId)
        {
            if (!ItemConfig.HasKey(itemId))
            {
                return false;
            }
            var config = ItemConfig.Get(itemId);
            return config.Type >= 101 && config.Type <= 112;
        }
        public bool IsWing(int itemId)
        {
            if (!ItemConfig.HasKey(itemId))
            {
                return false;
            }
            var config = ItemConfig.Get(itemId);
            return config.Type == 113 || config.Type == 39 || config.Type == 52;
        }
        public bool IsDogzEquip(int itemId)
        {
            if (!ItemConfig.HasKey(itemId))
            {
                return false;
            }
            var config = ItemConfig.Get(itemId);
            return config.Type >= 119 && config.Type <= 123;
        }
        public bool IsSpiritWeapon(int itemId)
        {
            if (!ItemConfig.HasKey(itemId))
            {
                return false;
            }
            var config = ItemConfig.Get(itemId);
            return config.Type >= 113 && config.Type <= 117;
        }
        public bool IsSuitEquip(int itemId)
        {
            if (!ItemConfig.HasKey(itemId))
            {
                return false;
            }
            var config = ItemConfig.Get(itemId);
            return config.SuiteiD > 0 && config.Type >= 101 && config.Type <= 112;
        }
        // public bool IsThanksItem(int itemID)
        // {
        //     if (AssistThanksGiftConfig.Get(itemID) == null)
        //     {
        //         return false;
        //     }
        //     return true;
        // }
        // public int GetSpecialSpiritPropertyValue(int itemId)
        // {
        //     var config = SpiritWeaponConfig.Get(itemId);
        //     if (config == null)
        //     {
        //         return 0;
        //     }
        //     var propertyId = 0;
        //     var propertyValue = 0;
        //     for (var i = 0; i < config.AttrIDList.Length; i++)
        //     {
        //         var id = config.AttrIDList[i];
        //         if (id == 79 || id == 80)
        //         {
        //             propertyId = id;
        //             propertyValue = config.AttrValueList[i];
        //             break;
        //         }
        //     }
        //     if (propertyId == 0)
        //     {
        //         return 0;
        //     }
        //     Equation.Instance.Clear();
        //     Equation.Instance.AddKeyValue("maxOOPValue", propertyValue);
        //     var maxLevel = 100;
        //     if (specialSpiritPropertyMaxLevels.ContainsKey(config.Level))
        //     {
        //         maxLevel = specialSpiritPropertyMaxLevels[config.Level];
        //     }
        //     Equation.Instance.AddKeyValue("lv", Mathf.Min(maxLevel, PlayerDatas.Instance.baseData.LV));
        //     return Equation.Instance.Eval<int>(specialSpiritPropertyFormula[propertyId]);
        // }
        // public int GetSpecialSpiritPropertyMaxLevel(int itemId)
        // {
        //     var config = SpiritWeaponConfig.Get(itemId);
        //     if (config == null)
        //     {
        //         return 0;
        //     }
        //     var maxLevel = 0;
        //     if (specialSpiritPropertyMaxLevels.ContainsKey(config.Level))
        //     {
        //         maxLevel = specialSpiritPropertyMaxLevels[config.Level];
        //     }
        //     return maxLevel;
        // }
        //装备对比,用于非实际装备简单比较 是否需要此装备
        // public bool IsSatisfyEquipBetterEquip(int itemID)
        // {
        //     if (!IsRealmEquip(itemID))
        //     {
        //         return false;
        //     }
        //     var itemConfig = ItemConfig.Get(itemID);
        //     if (itemConfig.JobLimit != 0 && itemConfig.JobLimit != PlayerDatas.Instance.baseData.Job)
        //     {
        //         return false;
        //     }
        //     var equipSet = equipModel.GetEquipSet(itemConfig.LV);
        //     if (!equipSet.IsSlotUnLocked(itemConfig.EquipPlace))
        //     {
        //         return false;
        //     }
        //     var equipGuid = equipModel.GetEquip(new Int2(itemConfig.LV, itemConfig.EquipPlace));
        //     if (string.IsNullOrEmpty(equipGuid))
        //     {
        //         return true;
        //     }
        //     var itemModel = packModel.GetItemByGuid(equipGuid);
        //     if (itemModel == null)
        //     {
        //         return true;
        //     }
        //     if (itemConfig.ItemColor > itemModel.config.ItemColor)
        //     {
        //         return true;
        //     }
        //     return itemModel.config.SuiteiD == 0 && itemConfig.SuiteiD != 0;
        // }
        public Action OnGetItem;    //CommonGetItemWin界面关闭时触发
        public string getItemInfo { get; private set; }  //通用显示获得的界面信息
        public string getItemBtnText { get; private set; }  //通用显示获得的界面按钮文字 默认确定
        public int closeSeconds { get; private set; } // 关闭倒计时时间 如果传0代表手动关闭
        public bool isNameShow { get; private set; } // 是否展示物品名字
        // 如果同时有多种奖励封包,同一个事件归集,不同事件直接顶掉显示最新
        public Dictionary<int, Item> totalShowItems = new Dictionary<int, Item>();
        public event Action OnGetItemShowEvent;
        private string getItemEventName;
        // 通用显示获得的物品
        public void ShowGetItem(List<Item> items, string info = "", int seconds = 3, string btnName = "", Action func = null, bool isNameShow = true, string eventName = "default")
        {
            if (getItemEventName != eventName)
            {
                if (UIManager.Instance.IsOpenedInList<CommonGetItemWin>())
                {
                    //----------------------记得改立即关闭
                    UIManager.Instance.CloseWindow<CommonGetItemWin>();
                }
                totalShowItems.Clear();
                getItemEventName = eventName;
            }
            //相同ID 合并数量显示
            for (int i = 0; i < items.Count; i++)
            {
                var id = items[i].id;
                if (totalShowItems.ContainsKey(id))
                {
                    totalShowItems[id] = new Item(id, items[i].countEx + totalShowItems[id].countEx, items[i].bind, items[i].quality);
                }
                else
                {
                    totalShowItems.Add(id, items[i]);
                }
            }
            getItemInfo = info;
            OnGetItem = func;
            if (btnName == "")
                btnName = Language.Get("PopConfirmWin_OK");
            getItemBtnText = btnName;
            closeSeconds = seconds;
            this.isNameShow = isNameShow;
            OnGetItemShowEvent?.Invoke();
            if (!UIManager.Instance.IsOpenedInList<CommonGetItemWin>())
            {
                UIManager.Instance.OpenWindow<CommonGetItemWin>();
            }
        }
        //可以指定打开的窗口
        public void ShowGetItemEx<T>(List<Item> items, string info = "", int seconds = 3, string btnName = "", Action func = null, bool isNameShow = true, string eventName = "default") where T : UIBase
        {
            if (getItemEventName != eventName)
            {
                if (UIManager.Instance.IsOpenedInList<T>())
                {
                    //----------------------记得改立即关闭
                    UIManager.Instance.CloseWindow<T>();
                }
                totalShowItems.Clear();
                getItemEventName = eventName;
            }
            //相同ID 合并数量显示
            for (int i = 0; i < items.Count; i++)
            {
                var id = items[i].id;
                if (totalShowItems.ContainsKey(id))
                {
                    totalShowItems[id] = new Item(id, items[i].countEx + totalShowItems[id].countEx, items[i].bind, items[i].quality);
                }
                else
                {
                    totalShowItems.Add(id, items[i]);
                }
            }
            getItemInfo = info;
            OnGetItem = func;
            if (btnName == "")
                btnName = Language.Get("PopConfirmWin_OK");
            getItemBtnText = btnName;
            closeSeconds = seconds;
            this.isNameShow = isNameShow;
            OnGetItemShowEvent?.Invoke();
            if (!UIManager.Instance.IsOpenedInList<T>())
            {
                UIManager.Instance.OpenWindow<T>();
            }
        }
        public void ClearGetItem()
        {
            //不清理物品,下次收到数据会自动清理,只改事件方便打开界面测试
            getItemEventName = "";
            return isoverdue;
        }
    }
    #endregion
    public bool IsJobCompatibleItem(int itemId)
    {
        var config = ItemConfig.Get(itemId);
        return config != null && (config.JobLimit == 0 || config.JobLimit == PlayerDatas.Instance.baseData.Job);
    }
    public bool IsRealmEquip(int itemId)
    {
        if (!ItemConfig.HasKey(itemId))
        {
            return false;
        }
        var config = ItemConfig.Get(itemId);
        return config.Type >= 101 && config.Type <= 112;
    }
    public bool IsWing(int itemId)
    {
        if (!ItemConfig.HasKey(itemId))
        {
            return false;
        }
        var config = ItemConfig.Get(itemId);
        return config.Type == 113 || config.Type == 39 || config.Type == 52;
    }
    public bool IsDogzEquip(int itemId)
    {
        if (!ItemConfig.HasKey(itemId))
        {
            return false;
        }
        var config = ItemConfig.Get(itemId);
        return config.Type >= 119 && config.Type <= 123;
    }
    public bool IsSpiritWeapon(int itemId)
    {
        if (!ItemConfig.HasKey(itemId))
        {
            return false;
        }
        var config = ItemConfig.Get(itemId);
        return config.Type >= 113 && config.Type <= 117;
    }
    public bool IsSuitEquip(int itemId)
    {
        if (!ItemConfig.HasKey(itemId))
        {
            return false;
        }
        var config = ItemConfig.Get(itemId);
        return config.SuiteiD > 0 && config.Type >= 101 && config.Type <= 112;
    }
    // public bool IsThanksItem(int itemID)
    // {
    //     if (AssistThanksGiftConfig.Get(itemID) == null)
    //     {
    //         return false;
    //     }
    //     return true;
    // }
    // public int GetSpecialSpiritPropertyValue(int itemId)
    // {
    //     var config = SpiritWeaponConfig.Get(itemId);
    //     if (config == null)
    //     {
    //         return 0;
    //     }
    //     var propertyId = 0;
    //     var propertyValue = 0;
    //     for (var i = 0; i < config.AttrIDList.Length; i++)
    //     {
    //         var id = config.AttrIDList[i];
    //         if (id == 79 || id == 80)
    //         {
    //             propertyId = id;
    //             propertyValue = config.AttrValueList[i];
    //             break;
    //         }
    //     }
    //     if (propertyId == 0)
    //     {
    //         return 0;
    //     }
    //     Equation.Instance.Clear();
    //     Equation.Instance.AddKeyValue("maxOOPValue", propertyValue);
    //     var maxLevel = 100;
    //     if (specialSpiritPropertyMaxLevels.ContainsKey(config.Level))
    //     {
    //         maxLevel = specialSpiritPropertyMaxLevels[config.Level];
    //     }
    //     Equation.Instance.AddKeyValue("lv", Mathf.Min(maxLevel, PlayerDatas.Instance.baseData.LV));
    //     return Equation.Instance.Eval<int>(specialSpiritPropertyFormula[propertyId]);
    // }
    // public int GetSpecialSpiritPropertyMaxLevel(int itemId)
    // {
    //     var config = SpiritWeaponConfig.Get(itemId);
    //     if (config == null)
    //     {
    //         return 0;
    //     }
    //     var maxLevel = 0;
    //     if (specialSpiritPropertyMaxLevels.ContainsKey(config.Level))
    //     {
    //         maxLevel = specialSpiritPropertyMaxLevels[config.Level];
    //     }
    //     return maxLevel;
    // }
    //装备对比,用于非实际装备简单比较 是否需要此装备
    // public bool IsSatisfyEquipBetterEquip(int itemID)
    // {
    //     if (!IsRealmEquip(itemID))
    //     {
    //         return false;
    //     }
    //     var itemConfig = ItemConfig.Get(itemID);
    //     if (itemConfig.JobLimit != 0 && itemConfig.JobLimit != PlayerDatas.Instance.baseData.Job)
    //     {
    //         return false;
    //     }
    //     var equipSet = equipModel.GetEquipSet(itemConfig.LV);
    //     if (!equipSet.IsSlotUnLocked(itemConfig.EquipPlace))
    //     {
    //         return false;
    //     }
    //     var equipGuid = equipModel.GetEquip(new Int2(itemConfig.LV, itemConfig.EquipPlace));
    //     if (string.IsNullOrEmpty(equipGuid))
    //     {
    //         return true;
    //     }
    //     var itemModel = packModel.GetItemByGuid(equipGuid);
    //     if (itemModel == null)
    //     {
    //         return true;
    //     }
    //     if (itemConfig.ItemColor > itemModel.config.ItemColor)
    //     {
    //         return true;
    //     }
    //     return itemModel.config.SuiteiD == 0 && itemConfig.SuiteiD != 0;
    // }
    public Action OnGetItem;    //CommonGetItemWin界面关闭时触发
    public string getItemInfo { get; private set; }  //通用显示获得的界面信息
    public string getItemBtnText { get; private set; }  //通用显示获得的界面按钮文字 默认确定
    public int closeSeconds { get; private set; } // 关闭倒计时时间 如果传0代表手动关闭
    public bool isNameShow { get; private set; } // 是否展示物品名字
    // 如果同时有多种奖励封包,同一个事件归集,不同事件直接顶掉显示最新
    public Dictionary<int, Item> totalShowItems = new Dictionary<int, Item>();
    public event Action OnGetItemShowEvent;
    private string getItemEventName;
    // 通用显示获得的物品
    public void ShowGetItem(List<Item> items, string info = "", int seconds = 3, string btnName = "", Action func = null, bool isNameShow = true, string eventName = "default")
    {
        if (getItemEventName != eventName)
        {
            if (UIManager.Instance.IsOpenedInList<CommonGetItemWin>())
            {
                //----------------------记得改立即关闭
                UIManager.Instance.CloseWindow<CommonGetItemWin>();
            }
            totalShowItems.Clear();
            getItemEventName = eventName;
        }
        //相同ID 合并数量显示
        for (int i = 0; i < items.Count; i++)
        {
            var id = items[i].id;
            if (totalShowItems.ContainsKey(id))
            {
                totalShowItems[id] = new Item(id, items[i].countEx + totalShowItems[id].countEx, items[i].bind, items[i].quality);
            }
            else
            {
                totalShowItems.Add(id, items[i]);
            }
        }
        getItemInfo = info;
        OnGetItem = func;
        if (btnName == "")
            btnName = Language.Get("PopConfirmWin_OK");
        getItemBtnText = btnName;
        closeSeconds = seconds;
        this.isNameShow = isNameShow;
        OnGetItemShowEvent?.Invoke();
        if (!UIManager.Instance.IsOpenedInList<CommonGetItemWin>())
        {
            UIManager.Instance.OpenWindow<CommonGetItemWin>();
        }
    }
    //可以指定打开的窗口
    public void ShowGetItemEx<T>(List<Item> items, string info = "", int seconds = 3, string btnName = "", Action func = null, bool isNameShow = true, string eventName = "default") where T : UIBase
    {
        if (getItemEventName != eventName)
        {
            if (UIManager.Instance.IsOpenedInList<T>())
            {
                //----------------------记得改立即关闭
                UIManager.Instance.CloseWindow<T>();
            }
            totalShowItems.Clear();
            getItemEventName = eventName;
        }
        //相同ID 合并数量显示
        for (int i = 0; i < items.Count; i++)
        {
            var id = items[i].id;
            if (totalShowItems.ContainsKey(id))
            {
                totalShowItems[id] = new Item(id, items[i].countEx + totalShowItems[id].countEx, items[i].bind, items[i].quality);
            }
            else
            {
                totalShowItems.Add(id, items[i]);
            }
        }
        getItemInfo = info;
        OnGetItem = func;
        if (btnName == "")
            btnName = Language.Get("PopConfirmWin_OK");
        getItemBtnText = btnName;
        closeSeconds = seconds;
        this.isNameShow = isNameShow;
        OnGetItemShowEvent?.Invoke();
        if (!UIManager.Instance.IsOpenedInList<T>())
        {
            UIManager.Instance.OpenWindow<T>();
        }
    }
    public void ClearGetItem()
    {
        //不清理物品,下次收到数据会自动清理,只改事件方便打开界面测试
        getItemEventName = "";
    }
}
Main/System/KnapSack/Logic/PackGirdCell.cs
@@ -1,4 +1,5 @@
using UnityEngine;
using UnityEngine.UI;
/// <summary>
/// 背包格子
@@ -6,12 +7,18 @@
public class PackGirdCell : MonoBehaviour
{
    [SerializeField] ItemCell itemCell;
    [SerializeField] RedpointBehaviour redPoint;    // 此处红点可以用图片表示
    [SerializeField] Image redPoint;    // 用图标代替简化ID管理
    public void Display(int index)
    {
        var guid = PackManager.Instance.GetSinglePack(PackType.Item).itemGuidList[index];
        if (string.IsNullOrEmpty(guid))
            return;
        itemCell.Init(PackManager.Instance.GetItemByGuid(guid));
        itemCell.button.AddListener(()=>
        {
            ItemTipUtility.Show(guid);
        });
        redPoint.SetActive(false);
    }
}
Main/System/KnapSack/Logic/PackGirdCell.cs.meta
@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 3c64a63d0c44fce40a3d1b90b18b2324
guid: d7093aa7f47948a4c9e4a824b10f4845
MonoImporter:
  externalObjects: {}
  serializedVersion: 2
Main/System/KnapSack/Logic/RolePackWin.cs
@@ -8,7 +8,7 @@
{
    [SerializeField] ScrollerController packScroller;
    [SerializeField] ScrollerController composeScroller;
    [SerializeField] ScrollerController composeScroller;    //待策划确定
    [SerializeField] GroupButtonEx packBtn;
    [SerializeField] GroupButtonEx composeBtn;
@@ -87,7 +87,7 @@
    }
    void RefreshItemEvent(PackType type, int index, int itemID)
    {
    {
        if (type != PackType.Item)
        {
            return;
@@ -98,7 +98,11 @@
    public override void Refresh()
    {
        if (functionOrder == 1)
        {
            RefreshComposeItemData();
        }
        packScroller.SetActive(functionOrder == 0);
        composeScroller.SetActive(functionOrder != 0);
        CreatePackScroller();
@@ -170,6 +174,15 @@
        {
            return;
        }
        composeScroller.Refresh();
        for (int i = 0; i < PackManager.Instance.composeItemGuidList.Count; i++)
        {
            if (i % 5 == 0)
            {
                composeScroller.AddCell(ScrollerDataType.Header, i);
            }
        }
        composeScroller.Restart();
    }
    void RefreshPackCell(ScrollerDataType type, CellView cell)
@@ -180,5 +193,12 @@
    void RefreshComposeCell(ScrollerDataType type, CellView cell)
    {
        var _cell = cell as ComposeLineCell;
        _cell.Display(cell.index);
    }
    void RefreshComposeItemData()
    {
        PackManager.Instance.composeItemGuidList.Clear();
    }
}
Main/System/KnapSack/Logic/SinglePack.cs
@@ -247,18 +247,6 @@
                continue;
            }
            //var auctionValid = filterParams.isAuction == item.isAuction;
            //if (!auctionValid)
            //{
            //    continue;
            //}
            var realmValid = filterParams.realmLimit == 0 || filterParams.realmLimit == item.config.RealmLimit;
            if (!realmValid)
            {
                continue;
            }
            list.Add(item);
        }
@@ -376,7 +364,6 @@
        public List<int> qualitys;
        public List<int> itemTypes;
        public List<int> equipTypes;
        public int realmLimit;
        public bool isAuction;
        public List<int> jobs;
    }
Main/System/KnapSack/Logic/composeLineCell.cs
@@ -3,12 +3,22 @@
/// <summary>
/// 合成格子行
/// </summary>
public class composeLineCell : CellView
public class ComposeLineCell : CellView
{
    [SerializeField] PackGirdCell[] itemCell;
    [SerializeField] ComposeGirdCell[] itemCell;
    public void Display(int index)
    {
        for (int i = 0; i < itemCell.Length; i++)
        {
            if (index + i < PackManager.Instance.composeItemGuidList.Count)
            {
                itemCell[i].SetActive(true);
                itemCell[i].Display(index + i);
            }
            else
            {
                itemCell[i].SetActive(false);
            }
        }
    }
}
Main/System/KnapSack/New/CommonItemBaisc.cs
@@ -214,7 +214,7 @@
        itemIcon.SetActive(true);
        bgIcon.SetActive(true);
        itemIcon.SetSprite(config.IconKey);
        itemIcon.SetOrgSprite(config.IconKey);
        ItemConfig itemConfig = ItemConfig.Get(itemId);
        bgIcon.SetItemBackGround(ItemLogicUtility.Instance.GetItemQuality(itemId, useDataDic));
        if (packModel.textCountShow.ContainsKey(itemId))
@@ -265,6 +265,7 @@
        //         break;
        // }
        //待策划确定
        if (config.Type == (int)ItemType.Hero)
        {
            var heroConfig = HeroConfig.Get(itemId);
@@ -276,7 +277,7 @@
        {
            countryIcon.SetActive(false);
        }
        // pieceIcon.SetActive(); //待策划确定
        // pieceIcon.SetActive();
    }
    // / <summary>
Main/System/KnapSack/PackManager.cs
@@ -12,6 +12,7 @@
    public Dictionary<int, int> PackInitCountDict = new Dictionary<int, int>(); //背包类型:初始数量
    public int initBagGridCount { get; private set; } //初始物品背包格子数
    public int[] itemPackSortTyps { get; private set; }    //背包物品的按类型排序
    public List<string> composeItemGuidList = new List<string>();  //合成列表物品guid
    public static string StrengthAttrShift_RecordKey = "";
    public const string RecordKnapsackTitle = "RecordKnapsackTitle";
Main/System/Main/HomeWin.cs
@@ -124,7 +124,7 @@
            taskNumText.text = string.Format("({0}/{1})", task.CurValue, taskConfig.NeedValue);
            taskNumText.color = task.CurValue >= taskConfig.NeedValue ? UIHelper.GetUIColor(TextColType.NavyYellow) :  UIHelper.GetUIColor(TextColType.Red);
            taskEffect.SetActive(TaskManager.Instance.GetMainTaskState() == 2);
            awardIcon.SetSprite(ItemConfig.Get(taskConfig.AwardItemList[0][0]).IconKey);
            awardIcon.SetOrgSprite(ItemConfig.Get(taskConfig.AwardItemList[0][0]).IconKey);
            awardCnt.text = taskConfig.AwardItemList[0][1].ToString();
        }
    }
Main/System/Team/TeamManager.cs
@@ -12,17 +12,13 @@
    {
        base.Init();
        
        HeroManager.Instance.onHeroChangeEvent += onHeroChangeEvent;
        HeroManager.Instance.onHeroDeleteEvent += onHeroDeleteEvent;
        DTC0102_tagCDBPlayer.beforePlayerDataInitializeEvent += OnBeforePlayerDataInitialize;
    }
    public override void Release()
    {
        base.Release();
        HeroManager.Instance.onHeroChangeEvent += onHeroChangeEvent;
        HeroManager.Instance.onHeroDeleteEvent += onHeroDeleteEvent;
        DTC0102_tagCDBPlayer.beforePlayerDataInitializeEvent += OnBeforePlayerDataInitialize;
        DTC0102_tagCDBPlayer.beforePlayerDataInitializeEvent -= OnBeforePlayerDataInitialize;
    }
    protected void OnBeforePlayerDataInitialize()
@@ -30,114 +26,36 @@
        teamDict.Clear();
    }
    protected void onHeroChangeEvent(HeroInfo heroInfo)
    public void OnHeroChangeEvent(HB124_tagSCLineupInfo vNetData)
    {
        //  英雄当前所有在的队伍
        List<int> heroTeams = heroInfo.itemHero.GetUseData(81);
        //  当前英雄所在的队伍信息 <队伍类型, <队形, 位置>>
        Dictionary<TeamType, KeyValuePair<int, int>> teamTypeShapeTypePositionDict = new Dictionary<TeamType, KeyValuePair<int, int>>();
        //  处理当前记录在英雄信息里的队伍信息
        if (null != heroTeams)
        var heroPack = PackManager.Instance.GetSinglePack(PackType.Hero);
        for (int i = 0; i < vNetData.LineupCnt; i++)
        {
            foreach (var teamMsg in heroTeams)
            var team = GetTeam((TeamType)vNetData.LineupList[i].LineupID);
            for (int j = 0; j < vNetData.LineupList[i].HeroCnt; j++)
            {
                // 所在阵容信息列表 [阵容类型*10000+阵型类型*100+位置编号, ...]
                int teamType = teamMsg / 10000;
                int shapeType = (teamMsg % 10000) / 100;
                int positionIndex = teamMsg % 100 - 1;    //布阵位置:服务端为 1  客户端为0
                if (teamTypeShapeTypePositionDict.ContainsKey((TeamType)teamType))
                int index = vNetData.LineupList[i].HeroItemIndexList[j];
                HeroInfo hero;
                if (index == 0)
                {
                    //  队伍类型相同,更新阵型和位置
                    Debug.LogError("当前英雄拥有两个相同的队伍信息: " + teamType + " " + shapeType + " " + positionIndex + ", hero guid is " + heroInfo.itemHero.guid);
                    hero = null;
                }
                else
                {
                    //  队伍类型不同,添加新的
                    KeyValuePair<int, int> shapeTypePosition = new KeyValuePair<int, int>(shapeType, positionIndex);
                    teamTypeShapeTypePositionDict.Add((TeamType)teamType, shapeTypePosition);
                    var item = heroPack.GetItemByIndex(vNetData.LineupList[i].HeroItemIndexList[j] - 1);
                    if (item == null)
                    {
                        hero = null;
                        Debug.LogError("没有对应的武将数据!");
                    }
                    hero = HeroManager.Instance.GetHero(item.guid);
                }
                team.RefreshServerData(vNetData.LineupList[i].ShapeType, j, hero);
            }
        }
    }
        //  遍历当前所有队伍 判断当前队伍里是否有该英雄
        //  如果有的话 根据英雄里的信息当前是否该英雄还在队伍里 是否发生变化
        //      =>1.阵型发生变化 2.位置发生变化
        //  如果没有的话 就说明该英雄被移出队伍了
        foreach (var team in teamDict.Values)
        {
            //  检查一下当前队伍是否有该英雄
            //  如果有的话 读取一下当前是否该英雄还在队伍里 位置是否发生变化
            TeamHero teamHero = team.GetHero(heroInfo.itemHero.guid);
            if (teamHero != null)
            {
                if ((teamTypeShapeTypePositionDict.ContainsKey(team.teamType)))
                {
                    KeyValuePair<int, int> shapeTypePosition = teamTypeShapeTypePositionDict[team.teamType];
                    //  更新队伍信息
                    // 可以判断teamHero的positionNum是否跟shapeTypePosition.Value一致 判断是否变位置了
                    // 可以判断teamHero的ServerShapeType是否跟shapeTypePosition.Key一致 判断是否变阵型了
                    team.RefreshServerData(shapeTypePosition.Key, shapeTypePosition.Value, heroInfo);
                }
                else
                {
                    //  队伍里有这个英雄,但是在队伍信息里没有了 置空 (被移出队伍)
                    team.RemoveHero(teamHero.positionNum);
                }
            }
            //    原来队伍里没这个英雄
            else
            {
                //  如果当前队伍类型在英雄的所在阵容信息列表里有的话
                //    就说明队伍里新增了这个英雄 (新增进队伍)
                if (teamTypeShapeTypePositionDict.ContainsKey(team.teamType))
                {
                    KeyValuePair<int, int> shapeTypePosition = teamTypeShapeTypePositionDict[team.teamType];
                    team.RefreshServerData(shapeTypePosition.Key, shapeTypePosition.Value, heroInfo);
                }
            }
        }
        //  遍历英雄所在的队伍信息列表 新增一下当前储存的队伍里没有的队伍
        foreach (var teamTypeShapeTypePosition in teamTypeShapeTypePositionDict)
        {
            //  如果当前队伍类型在队伍字典里没有的话
            if (!teamDict.ContainsKey(teamTypeShapeTypePosition.Key))
            {
                //  新建一个队伍
                TeamBase team = new TeamBase(teamTypeShapeTypePosition.Key);
                team.RefreshServerData(teamTypeShapeTypePosition.Value.Key, teamTypeShapeTypePosition.Value.Value, heroInfo);
                teamDict.Add(teamTypeShapeTypePosition.Key, team);
            }
        }
    }
    protected void onHeroDeleteEvent(HeroInfo heroInfo)
    {
        List<int> heroTeams = heroInfo.itemHero.GetUseData(81);
        foreach (int teamMsg in heroTeams)
        {
            // 所在阵容信息列表 [阵容类型*10000+阵型类型*100+位置编号, ...]
            int teamType = teamMsg / 10000;
            int shapeType = (teamMsg % 10000) / 100;
            int positionIndex = teamMsg % 100 - 1; //布阵位置:服务端为 1  客户端为0
            TeamBase team = GetTeam((TeamType)teamType);
            if (team != null)
            {
                team.RefreshServerData(shapeType, positionIndex, null);
            }
        }
    }
    public bool HasTeam(TeamType teamType)
    {
Main/Utility/ComponentExtersion.cs
@@ -270,7 +270,7 @@
        }
    }
    //通过ICON表加载
    public static void SetSprite(this Image _image, string _id)
    {
        if (_image == null)
@@ -294,6 +294,17 @@
        _textImage.sprite = sprite;
    }
    //通过图片名加载
    public static void SetOrgSprite(this Image _image, string iconName, string folderName = "icon")
    {
        if (_image == null)
        {
            return;
        }
        var sprite = UILoader.LoadSprite(folderName, iconName);
        _image.overrideSprite = sprite;
    }
    public static void SetActive(this Component compoent, bool active)
    {