少年修仙传客户端代码仓库
9895 子 【BT0.1】【主干】坐骑、灵宠、称号升星 / 【BT0.1】坐骑、灵宠、称号升星 - 坐骑升星, 并删除了很古老的坐骑升级消耗表

# Conflicts:
# Core/GameEngine/DataToCtl/PackageRegedit.cs
# System/Mount/MountWin.cs
6 文件已复制
11个文件已修改
7个文件已添加
3个文件已删除
3 文件已重命名
2372 ■■■■■ 已修改文件
Core/GameEngine/Model/Config/HorseStarUpConfig.cs 88 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Core/GameEngine/Model/Config/HorseStarUpConfig.cs.meta 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Core/GameEngine/Model/Config/HorseUpConfig.cs.meta 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Core/GameEngine/Model/TelPartialConfig/HorseStarUpConfig.cs 29 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Core/GameEngine/Model/TelPartialConfig/HorseStarUpConfig.cs.meta 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Core/GameEngine/Model/TelPartialConfig/tagHorseUpConfig.cs 94 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Core/NetworkPackage/ClientPack/ClientToMapServer/CA5_Function/CA535_tagCMHorseStarUp.cs 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Core/NetworkPackage/ClientPack/ClientToMapServer/CA5_Function/CA535_tagCMHorseStarUp.cs.meta 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Core/NetworkPackage/ClientPack/ClientToMapServer/CA5_Function/CA536_tagCMTitleStarUp.cs 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Core/NetworkPackage/ClientPack/ClientToMapServer/CA5_Function/CA536_tagCMTitleStarUp.cs.meta 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Core/NetworkPackage/DTCFile/ServerPack/HA3_Function/DTCA3CD_tagMCHorseStarInfo.cs 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Core/NetworkPackage/DTCFile/ServerPack/HA3_Function/DTCA3CD_tagMCHorseStarInfo.cs.meta 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Core/NetworkPackage/DTCFile/ServerPack/HA3_Function/DTCA3CE_tagMCTitleStarInfo.cs 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Core/NetworkPackage/DTCFile/ServerPack/HA3_Function/DTCA3CE_tagMCTitleStarInfo.cs.meta 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Core/NetworkPackage/ServerPack/HA3_Function/HA3CD_tagMCHorseStarInfo.cs 29 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Core/NetworkPackage/ServerPack/HA3_Function/HA3CD_tagMCHorseStarInfo.cs.meta 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Core/NetworkPackage/ServerPack/HA3_Function/HA3CE_tagMCTitleStarInfo.cs 29 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Core/NetworkPackage/ServerPack/HA3_Function/HA3CE_tagMCTitleStarInfo.cs.meta 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/ItemTip/TipPetMountSkillWidget.cs 150 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/KnapSack/Logic/ItemTipsModel.cs 21 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/Mount/AutoTrainTipsWin.cs 257 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/Mount/MountModel.cs 187 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/Mount/MountSkinWin.cs 913 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/Mount/SelectThemount.cs 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/Pet/RidingAndPetActivationModel.cs 40 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/Pet/TargetPetAttrWin.cs 93 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/RoleParticulars/RoleParticularModel.cs 266 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/RoleParticulars/RoleParticularsWin.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/RoleParticulars/ViewHorseDetailWin.cs 50 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Utility/ConfigInitiator.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
Core/GameEngine/Model/Config/HorseStarUpConfig.cs
File was renamed from Core/GameEngine/Model/Config/HorseUpConfig.cs
@@ -1,6 +1,6 @@
//--------------------------------------------------------
//    [Author]:           Fish
//    [  Date ]:           Wednesday, May 15, 2019
//    [  Date ]:           2023年10月22日
//--------------------------------------------------------
using System.Collections.Generic;
@@ -8,60 +8,50 @@
using System.Threading;
using System;
using UnityEngine;
using LitJson;
using System.Linq;
public partial class HorseUpConfig
public partial class HorseStarUpConfig
{
    public readonly int ID;
    public readonly int id;
    public readonly int HorseID;
    public readonly int LV;
    public readonly int NeedExp;
    public readonly int[] AttrType;
    public readonly int[] AttrValue;
    public readonly int[] SkillID;
    public readonly int NeedExpTotal;
    public readonly int HorseStar;
    public readonly List<int[]> StarUpNeedItemList;
    public readonly int[] StarAttrType;
    public readonly int[] StarAttrValue;
    public HorseUpConfig()
    public HorseStarUpConfig()
    {
    }
    public HorseUpConfig(string input)
    public HorseStarUpConfig(string input)
    {
        try
        {
            var tables = input.Split('\t');
            int.TryParse(tables[0],out ID);
            int.TryParse(tables[0],out id);
            int.TryParse(tables[1],out HorseID); 
            int.TryParse(tables[2],out LV);
            int.TryParse(tables[2],out HorseStar);
            int.TryParse(tables[3],out NeedExp);
            StarUpNeedItemList = JsonMapper.ToObject<int[][]>(tables[3]).ToList();
            string[] AttrTypeStringArray = tables[4].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries);
            AttrType = new int[AttrTypeStringArray.Length];
            for (int i=0;i<AttrTypeStringArray.Length;i++)
            {
                 int.TryParse(AttrTypeStringArray[i],out AttrType[i]);
            string[] StarAttrTypeStringArray = tables[4].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries);
            StarAttrType = new int[StarAttrTypeStringArray.Length];
            for (int i=0;i<StarAttrTypeStringArray.Length;i++)
            {
                 int.TryParse(StarAttrTypeStringArray[i],out StarAttrType[i]);
            }
            string[] AttrValueStringArray = tables[5].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries);
            AttrValue = new int[AttrValueStringArray.Length];
            for (int i=0;i<AttrValueStringArray.Length;i++)
            {
                 int.TryParse(AttrValueStringArray[i],out AttrValue[i]);
            string[] StarAttrValueStringArray = tables[5].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries);
            StarAttrValue = new int[StarAttrValueStringArray.Length];
            for (int i=0;i<StarAttrValueStringArray.Length;i++)
            {
                 int.TryParse(StarAttrValueStringArray[i],out StarAttrValue[i]);
            }
            string[] SkillIDStringArray = tables[6].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries);
            SkillID = new int[SkillIDStringArray.Length];
            for (int i=0;i<SkillIDStringArray.Length;i++)
            {
                 int.TryParse(SkillIDStringArray[i],out SkillID[i]);
            }
            int.TryParse(tables[7],out NeedExpTotal);
        }
        catch (Exception ex)
        {
@@ -69,12 +59,12 @@
        }
    }
    static Dictionary<string, HorseUpConfig> configs = new Dictionary<string, HorseUpConfig>();
    public static HorseUpConfig Get(string id)
    static Dictionary<string, HorseStarUpConfig> configs = new Dictionary<string, HorseStarUpConfig>();
    public static HorseStarUpConfig Get(string id)
    {   
        if (!inited)
        {
            Debug.Log("HorseUpConfig 还未完成初始化。");
            Debug.Log("HorseStarUpConfig 还未完成初始化。");
            return null;
        }
        
@@ -83,17 +73,17 @@
            return configs[id];
        }
        HorseUpConfig config = null;
        HorseStarUpConfig config = null;
        if (rawDatas.ContainsKey(id))
        {
            config = configs[id] = new HorseUpConfig(rawDatas[id]);
            config = configs[id] = new HorseStarUpConfig(rawDatas[id]);
            rawDatas.Remove(id);
        }
        return config;
    }
    public static HorseUpConfig Get(int id)
    public static HorseStarUpConfig Get(int id)
    {
        return Get(id.ToString());
    }
@@ -106,15 +96,15 @@
        return keys;
    }
    public static List<HorseUpConfig> GetValues()
    public static List<HorseStarUpConfig> GetValues()
    {
        var values = new List<HorseUpConfig>();
        var values = new List<HorseStarUpConfig>();
        values.AddRange(configs.Values);
        var keys = new List<string>(rawDatas.Keys);
        foreach (var key in keys)
        for (int i = 0; i < keys.Count; i++)
        {
            values.Add(Get(key));
            values.Add(Get(keys[i]));
        }
        return values;
@@ -138,15 +128,15 @@
        var path = string.Empty;
        if (AssetSource.refdataFromEditor)
        {
            path = ResourcesPath.CONFIG_FODLER +"/HorseUp.txt";
            path = ResourcesPath.CONFIG_FODLER +"/HorseStarUp.txt";
        }
        else
        {
            path = AssetVersionUtility.GetAssetFilePath("config/HorseUp.txt");
            path = AssetVersionUtility.GetAssetFilePath("config/HorseStarUp.txt");
        }
        configs.Clear();
        var tempConfig = new HorseUpConfig();
        var tempConfig = new HorseStarUpConfig();
        var preParse = tempConfig is IConfigPostProcess;
        if (sync)
@@ -170,7 +160,7 @@
                    if (preParse)
                    {
                        var config = new HorseUpConfig(line);
                        var config = new HorseStarUpConfig(line);
                        configs[id] = config;
                        (config as IConfigPostProcess).OnConfigParseCompleted();
                    }
@@ -209,7 +199,7 @@
                        if (preParse)
                        {
                            var config = new HorseUpConfig(line);
                            var config = new HorseStarUpConfig(line);
                            configs[id] = config;
                            (config as IConfigPostProcess).OnConfigParseCompleted();
                        }
Core/GameEngine/Model/Config/HorseStarUpConfig.cs.meta
copy from Core/GameEngine/Model/TelPartialConfig/tagHorseUpConfig.cs.meta copy to Core/GameEngine/Model/Config/HorseStarUpConfig.cs.meta
File was copied from Core/GameEngine/Model/TelPartialConfig/tagHorseUpConfig.cs.meta
@@ -1,8 +1,7 @@
fileFormatVersion: 2
guid: 95567471ba5b9dd44b507afebe648e87
timeCreated: 1502963061
licenseType: Pro
guid: b16167c21e45f054a9629b81bdc6461e
MonoImporter:
  externalObjects: {}
  serializedVersion: 2
  defaultReferences: []
  executionOrder: 0
Core/GameEngine/Model/Config/HorseUpConfig.cs.meta
File was deleted
Core/GameEngine/Model/TelPartialConfig/HorseStarUpConfig.cs
New file
@@ -0,0 +1,29 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public partial class HorseStarUpConfig : IConfigPostProcess
{
    public static Dictionary<int, List<int>> horseIDToIDs = new Dictionary<int, List<int>>(); //坐骑幻化升星
    public void OnConfigParseCompleted()
    {
        if (!horseIDToIDs.ContainsKey(HorseID))
        {
            horseIDToIDs.Add(HorseID, new List<int>());
        }
        horseIDToIDs[HorseID].Add(id);
    }
    public static List<int> GetIdsByHorseID(int horseID)
    {
        if (horseIDToIDs.ContainsKey(horseID))
        {
            return horseIDToIDs[horseID];
        }
        return null;
    }
}
Core/GameEngine/Model/TelPartialConfig/HorseStarUpConfig.cs.meta
File was renamed from Core/GameEngine/Model/TelPartialConfig/tagHorseUpConfig.cs.meta
@@ -1,8 +1,7 @@
fileFormatVersion: 2
guid: 95567471ba5b9dd44b507afebe648e87
timeCreated: 1502963061
licenseType: Pro
guid: d237c2b8c0ed77642ad62ce20c50e052
MonoImporter:
  externalObjects: {}
  serializedVersion: 2
  defaultReferences: []
  executionOrder: 0
Core/GameEngine/Model/TelPartialConfig/tagHorseUpConfig.cs
File was deleted
Core/NetworkPackage/ClientPack/ClientToMapServer/CA5_Function/CA535_tagCMHorseStarUp.cs
New file
@@ -0,0 +1,18 @@
using UnityEngine;
using System.Collections;
// A5 35 坐骑升星 #tagCMHorseStarUp
public class CA535_tagCMHorseStarUp : GameNetPackBasic {
    public uint HorseID;    //坐骑ID,对应坐骑表ID
    public CA535_tagCMHorseStarUp () {
        combineCmd = (ushort)0x03FE;
        _cmd = (ushort)0xA535;
    }
    public override void WriteToBytes () {
        WriteBytes (HorseID, NetDataType.DWORD);
    }
}
Core/NetworkPackage/ClientPack/ClientToMapServer/CA5_Function/CA535_tagCMHorseStarUp.cs.meta
File was renamed from System/Mount/AutoTrainTipsWin.cs.meta
@@ -1,8 +1,7 @@
fileFormatVersion: 2
guid: 11720f48ce490cb4eb9282355be5f5ff
timeCreated: 1516001401
licenseType: Free
guid: 73af8ddf1a5acbd43a3c7634c51d56ae
MonoImporter:
  externalObjects: {}
  serializedVersion: 2
  defaultReferences: []
  executionOrder: 0
Core/NetworkPackage/ClientPack/ClientToMapServer/CA5_Function/CA536_tagCMTitleStarUp.cs
New file
@@ -0,0 +1,18 @@
using UnityEngine;
using System.Collections;
// A5 36 称号升星 #tagCMTitleStarUp
public class CA536_tagCMTitleStarUp : GameNetPackBasic {
    public uint TitleID;    //称号ID
    public CA536_tagCMTitleStarUp () {
        combineCmd = (ushort)0x03FE;
        _cmd = (ushort)0xA536;
    }
    public override void WriteToBytes () {
        WriteBytes (TitleID, NetDataType.DWORD);
    }
}
Core/NetworkPackage/ClientPack/ClientToMapServer/CA5_Function/CA536_tagCMTitleStarUp.cs.meta
copy from System/Mount/AutoTrainTipsWin.cs.meta copy to Core/NetworkPackage/ClientPack/ClientToMapServer/CA5_Function/CA536_tagCMTitleStarUp.cs.meta
File was copied from System/Mount/AutoTrainTipsWin.cs.meta
@@ -1,8 +1,7 @@
fileFormatVersion: 2
guid: 11720f48ce490cb4eb9282355be5f5ff
timeCreated: 1516001401
licenseType: Free
guid: 47bd2356f8f54de468961466c91b7996
MonoImporter:
  externalObjects: {}
  serializedVersion: 2
  defaultReferences: []
  executionOrder: 0
Core/NetworkPackage/DTCFile/ServerPack/HA3_Function/DTCA3CD_tagMCHorseStarInfo.cs
New file
@@ -0,0 +1,15 @@
using UnityEngine;
using System.Collections;
using Snxxz.UI;
// A3 CD 坐骑星级信息 #tagMCHorseStarInfo
public class DTCA3CD_tagMCHorseStarInfo : DtcBasic {
    MountModel mountModel { get { return ModelCenter.Instance.GetModel<MountModel>(); } }
    public override void Done(GameNetPackBasic vNetPack) {
        base.Done(vNetPack);
        HA3CD_tagMCHorseStarInfo vNetData = vNetPack as HA3CD_tagMCHorseStarInfo;
        mountModel.UpdateHorseStarInfo(vNetData);
    }
}
Core/NetworkPackage/DTCFile/ServerPack/HA3_Function/DTCA3CD_tagMCHorseStarInfo.cs.meta
copy from System/Mount/AutoTrainTipsWin.cs.meta copy to Core/NetworkPackage/DTCFile/ServerPack/HA3_Function/DTCA3CD_tagMCHorseStarInfo.cs.meta
File was copied from System/Mount/AutoTrainTipsWin.cs.meta
@@ -1,8 +1,7 @@
fileFormatVersion: 2
guid: 11720f48ce490cb4eb9282355be5f5ff
timeCreated: 1516001401
licenseType: Free
guid: cccbe4ed544541e4ab18164430e884e2
MonoImporter:
  externalObjects: {}
  serializedVersion: 2
  defaultReferences: []
  executionOrder: 0
Core/NetworkPackage/DTCFile/ServerPack/HA3_Function/DTCA3CE_tagMCTitleStarInfo.cs
New file
@@ -0,0 +1,11 @@
using UnityEngine;
using System.Collections;
// A3 CE 称号星级信息 #tagMCTitleStarInfo
public class DTCA3CE_tagMCTitleStarInfo : DtcBasic {
    public override void Done(GameNetPackBasic vNetPack) {
        base.Done(vNetPack);
        HA3CE_tagMCTitleStarInfo vNetData = vNetPack as HA3CE_tagMCTitleStarInfo;
    }
}
Core/NetworkPackage/DTCFile/ServerPack/HA3_Function/DTCA3CE_tagMCTitleStarInfo.cs.meta
copy from System/Mount/AutoTrainTipsWin.cs.meta copy to Core/NetworkPackage/DTCFile/ServerPack/HA3_Function/DTCA3CE_tagMCTitleStarInfo.cs.meta
File was copied from System/Mount/AutoTrainTipsWin.cs.meta
@@ -1,8 +1,7 @@
fileFormatVersion: 2
guid: 11720f48ce490cb4eb9282355be5f5ff
timeCreated: 1516001401
licenseType: Free
guid: 57a249eb6099d224e87801e94dbdb655
MonoImporter:
  externalObjects: {}
  serializedVersion: 2
  defaultReferences: []
  executionOrder: 0
Core/NetworkPackage/ServerPack/HA3_Function/HA3CD_tagMCHorseStarInfo.cs
New file
@@ -0,0 +1,29 @@
using UnityEngine;
using System.Collections;
// A3 CD 坐骑星级信息 #tagMCHorseStarInfo
public class HA3CD_tagMCHorseStarInfo : GameNetPackBasic {
    public byte Count;
    public  tagMCHorseStar[] HorseStarList;
    public HA3CD_tagMCHorseStarInfo () {
        _cmd = (ushort)0xA3CD;
    }
    public override void ReadFromBytes (byte[] vBytes) {
        TransBytes (out Count, vBytes, NetDataType.BYTE);
        HorseStarList = new tagMCHorseStar[Count];
        for (int i = 0; i < Count; i ++) {
            HorseStarList[i] = new tagMCHorseStar();
            TransBytes (out HorseStarList[i].HorseID, vBytes, NetDataType.DWORD);
            TransBytes (out HorseStarList[i].Star, vBytes, NetDataType.BYTE);
        }
    }
    public struct tagMCHorseStar {
        public uint HorseID;        // 坐骑表ID
        public byte Star;        // 星级
    }
}
Core/NetworkPackage/ServerPack/HA3_Function/HA3CD_tagMCHorseStarInfo.cs.meta
copy from System/Mount/AutoTrainTipsWin.cs.meta copy to Core/NetworkPackage/ServerPack/HA3_Function/HA3CD_tagMCHorseStarInfo.cs.meta
File was copied from System/Mount/AutoTrainTipsWin.cs.meta
@@ -1,8 +1,7 @@
fileFormatVersion: 2
guid: 11720f48ce490cb4eb9282355be5f5ff
timeCreated: 1516001401
licenseType: Free
guid: b9db0f104a0f45b4dac9f82736b83c51
MonoImporter:
  externalObjects: {}
  serializedVersion: 2
  defaultReferences: []
  executionOrder: 0
Core/NetworkPackage/ServerPack/HA3_Function/HA3CE_tagMCTitleStarInfo.cs
New file
@@ -0,0 +1,29 @@
using UnityEngine;
using System.Collections;
// A3 CE 称号星级信息 #tagMCTitleStarInfo
public class HA3CE_tagMCTitleStarInfo : GameNetPackBasic {
    public byte Count;
    public  tagMCTitleStar[] TitleStarList;
    public HA3CE_tagMCTitleStarInfo () {
        _cmd = (ushort)0xA3CE;
    }
    public override void ReadFromBytes (byte[] vBytes) {
        TransBytes (out Count, vBytes, NetDataType.BYTE);
        TitleStarList = new tagMCTitleStar[Count];
        for (int i = 0; i < Count; i ++) {
            TitleStarList[i] = new tagMCTitleStar();
            TransBytes (out TitleStarList[i].TitleID, vBytes, NetDataType.DWORD);
            TransBytes (out TitleStarList[i].Star, vBytes, NetDataType.BYTE);
        }
    }
    public struct tagMCTitleStar {
        public uint TitleID;        // 称号ID
        public byte Star;        // 星级
    }
}
Core/NetworkPackage/ServerPack/HA3_Function/HA3CE_tagMCTitleStarInfo.cs.meta
copy from System/Mount/AutoTrainTipsWin.cs.meta copy to Core/NetworkPackage/ServerPack/HA3_Function/HA3CE_tagMCTitleStarInfo.cs.meta
File was copied from System/Mount/AutoTrainTipsWin.cs.meta
@@ -1,8 +1,7 @@
fileFormatVersion: 2
guid: 11720f48ce490cb4eb9282355be5f5ff
timeCreated: 1516001401
licenseType: Free
guid: 6d0589f4972dc7249a7c849972bc392a
MonoImporter:
  externalObjects: {}
  serializedVersion: 2
  defaultReferences: []
  executionOrder: 0
System/ItemTip/TipPetMountSkillWidget.cs
@@ -1,81 +1,69 @@
//--------------------------------------------------------
//    [Author]:           第二世界
//    [  Date ]:           Tuesday, April 16, 2019
//--------------------------------------------------------
using UnityEngine;
using System.Collections;
using UnityEngine.UI;
using System.Collections.Generic;
namespace Snxxz.UI
{
    public class TipPetMountSkillWidget : MonoBehaviour
    {
        [SerializeField] ScrollerController m_Scroll;
        public void Display(PetMountTipWin.ShowType showType, int itemId)
        {
            var skillInfos = new List<SkillInfo>();
            switch (showType)
            {
                case PetMountTipWin.ShowType.Pet:
                    var petId = PetInfoConfig.GetItemUnLockPet(itemId);
                    var petConfig = PetInfoConfig.Get(petId);
                    var min = Mathf.Min(petConfig.SkillID.Length, petConfig.SkillUnLock.Length);
                    for (var i = 0; i < min; i++)
                    {
                        var skillId = petConfig.SkillID[i];
                        var unlockLevel = petConfig.SkillUnLock[i];
                        skillInfos.Add(new SkillInfo() { skillId = skillId, unlockLevel = unlockLevel });
                    }
                    break;
                case PetMountTipWin.ShowType.Mount:
                    var horseId = HorseConfig.GetItemUnLockHorse(itemId);
                    var horseUpConfigs = HorseUpConfig.GetMountlistById(horseId);
                    foreach (var config in horseUpConfigs)
                    {
                        foreach (var skill in config.SkillID)
                        {
                            if (skill > 0)
                            {
                                skillInfos.Add(new SkillInfo() { skillId = skill, unlockLevel = config.LV });
                            }
                        }
                    }
                    break;
            }
            m_Scroll.OnRefreshCell -= OnRefreshCell;
            m_Scroll.OnRefreshCell += OnRefreshCell;
            //m_Scroll.Init(skillInfos);
            m_Scroll.Refresh();
            foreach (var skillinfo in skillInfos)
            {
                CellInfo info = new CellInfo();
                info.infoInt1 = skillinfo.unlockLevel;
                m_Scroll.AddCell(ScrollerDataType.Header, skillinfo.skillId, info);
            }
            m_Scroll.Restart();
        }
        void OnRefreshCell(ScrollerDataType type, CellView cell)
        {
            var _cell = cell as TipPetMountSkillBehaviour;
            _cell.Display(cell.index, cell.info.Value.infoInt1);
        }
        public struct SkillInfo
        {
            public int skillId;
            public int unlockLevel;
        }
    }
}
//--------------------------------------------------------
//    [Author]:           第二世界
//    [  Date ]:           Tuesday, April 16, 2019
//--------------------------------------------------------
using UnityEngine;
using System.Collections;
using UnityEngine.UI;
using System.Collections.Generic;
namespace Snxxz.UI
{
    public class TipPetMountSkillWidget : MonoBehaviour
    {
        [SerializeField] ScrollerController m_Scroll;
        public void Display(PetMountTipWin.ShowType showType, int itemId)
        {
            var skillInfos = new List<SkillInfo>();
            switch (showType)
            {
                case PetMountTipWin.ShowType.Pet:
                    var petId = PetInfoConfig.GetItemUnLockPet(itemId);
                    var petConfig = PetInfoConfig.Get(petId);
                    var min = Mathf.Min(petConfig.SkillID.Length, petConfig.SkillUnLock.Length);
                    for (var i = 0; i < min; i++)
                    {
                        var skillId = petConfig.SkillID[i];
                        var unlockLevel = petConfig.SkillUnLock[i];
                        skillInfos.Add(new SkillInfo() { skillId = skillId, unlockLevel = unlockLevel });
                    }
                    break;
                case PetMountTipWin.ShowType.Mount:
                    break;
            }
            m_Scroll.OnRefreshCell -= OnRefreshCell;
            m_Scroll.OnRefreshCell += OnRefreshCell;
            //m_Scroll.Init(skillInfos);
            m_Scroll.Refresh();
            foreach (var skillinfo in skillInfos)
            {
                CellInfo info = new CellInfo();
                info.infoInt1 = skillinfo.unlockLevel;
                m_Scroll.AddCell(ScrollerDataType.Header, skillinfo.skillId, info);
            }
            m_Scroll.Restart();
        }
        void OnRefreshCell(ScrollerDataType type, CellView cell)
        {
            var _cell = cell as TipPetMountSkillBehaviour;
            _cell.Display(cell.index, cell.info.Value.infoInt1);
        }
        public struct SkillInfo
        {
            public int skillId;
            public int unlockLevel;
        }
    }
}
System/KnapSack/Logic/ItemTipsModel.cs
@@ -70,27 +70,6 @@
                {
                    unlockMountDict.Add(horselist[i].UnlockItemID, horselist[i]);
                }
                Dictionary<int, List<int>> skillDict = new Dictionary<int, List<int>>();
                List<HorseUpConfig> mountlist = HorseUpConfig.GetMountlistById(horselist[i].HorseID);
                if (mountlist != null)
                {
                    for (int j = 0; j < mountlist.Count; j++)
                    {
                        int[] skills = mountlist[j].SkillID;
                        List<int> skilllist = new List<int>();
                        if (skills != null)
                        {
                            for (int k = 0; k < skills.Length; k++)
                            {
                                if (skills[k] != 0)
                                {
                                    skilllist.Add(skills[k]);
                                    skillDict.Add(mountlist[j].LV, skilllist);
                                }
                            }
                        }
                    }
                }
            }
            #endregion
System/Mount/AutoTrainTipsWin.cs
File was deleted
System/Mount/MountModel.cs
@@ -81,6 +81,7 @@
    Dictionary<SkillEffectGroup, List<int>> integrationHorseSkills = new Dictionary<SkillEffectGroup, List<int>>();
    Dictionary<int, SkillEffectGroup> horseSkillEffectValues = new Dictionary<int, SkillEffectGroup>();
    Dictionary<int, int> horseSkills = new Dictionary<int, int>();
    public Dictionary<int, int> horseStarDict = new Dictionary<int, int>(); //坐骑幻化升星
    Dictionary<int, int> unLockSkinItems = new Dictionary<int, int>();
@@ -184,6 +185,7 @@
        HorseRidingBool = false;
        Wait = true;
        MountHA301MorePack = false;
        horseStarDict.Clear();
    }
    public void OnPlayerLoginOk()
@@ -227,7 +229,6 @@
    }
    List<HorseConfig> Hconfigs = new List<HorseConfig>();
    List<HorseUpConfig> Uconfigs = new List<HorseUpConfig>();
    public int RedPoint_HuaxingID = MainRedDot.RedPoint_MountPackKey * 10; //化形红点
    int RedPoint_DanID = MainRedDot.RedPoint_MountPackKey * 10 + 1; //可用坐骑丹红点
@@ -247,73 +248,7 @@
        }
    }
    private void MountChangeRedPoint()//坐骑激活红点
    {
        return;
        //foreach (var key in DeblockingRedPoint.Keys)
        //{
        //    DeblockingRedPoint[key].state = RedPointState.None;
        //}
        //if (!FuncOpen.Instance.IsFuncOpen(8))
        //{
        //    return;
        //}
        //if (Hconfigs.Count <= 0)
        //{
        //    Hconfigs = HorseConfig.GetValues();
        //}
        ////  var configs = HorseConfig.GetValues();
        //foreach (var config in Hconfigs)
        //{
        //    int unlockItemID = config.UnlockItemID;
        //    int itemCount = playerPack.GetItemCountByID(PackType.Item, unlockItemID);
        //    int unlockItemCnt = config.UnlockItemCnt;
        //    if (itemCount >= unlockItemCnt && !_DicHorse.ContainsKey(config.HorseID))
        //    {
        //        DeblockingRedPoint[config.HorseID].state = RedPointState.Simple;
        //    }
        //}
    }
    //void MountSkillAndItem()//获取坐骑技能
    //{
    //    if (GetMountSkillAndItem.Count != 0)
    //        return;
    //    if (Uconfigs.Count <= 0)
    //    {
    //        Uconfigs = HorseUpConfig.GetValues();
    //    }
    //    //var configs = HorseUpConfig.GetValues();
    //    foreach (var config in Uconfigs)
    //    {
    //        if (!HorseConfig.Has(config.HorseID))
    //        {
    //            continue;
    //        }
    //        for (int i = 0; i < config.SkillID.Length; i++)
    //        {
    //            int skillID = config.SkillID[i];
    //            if (skillID != 0 && !GetMountSkillAndItem.ContainsKey(skillID))
    //            {
    //                SkillConfig _skillModel = SkillConfig.Get(skillID);
    //                if (_skillModel == null)
    //                {
    //                    Debug.Log(skillID);
    //                }
    //                HorseSkillClass horseSkillClass = new HorseSkillClass();
    //                horseSkillClass.SkillID = skillID;
    //                horseSkillClass.SkillItem = _skillModel.ExAttr4;
    //                horseSkillClass.HorseID = config.HorseID;
    //                horseSkillClass.HorseLV = config.LV;
    //                GetMountSkillAndItem.Add(skillID, horseSkillClass);
    //            }
    //        }
    //    }
    //}
    //private const int Redpoint_key1 = 1050101;
    //public Redpoint redPointStre1 = new Redpoint(MainRedDot.RedPoint_MountPackKey, Redpoint_key1);//坐骑外观
    private const int Redpoint_key2 = MainRedDot.RedPoint_MountPackKey * 10 + 2;
    public Redpoint redPointStre2 = new Redpoint(MainRedDot.RedPoint_MountPackKey, Redpoint_key2);//坐骑兽魂
@@ -344,6 +279,11 @@
                {
                    DeblockingRedPoint[activeID].state = RedPointState.Simple;
                }
                else
                {
                    RefreshStarRedpoint(id);
                }
            }
            ForsterHorseRed(id);
@@ -368,10 +308,43 @@
                {
                    DeblockingRedPoint[activeID].state = RedPointState.Simple;
                }
                else
                {
                    RefreshStarRedpoint(id);
                }
            }
            ForsterHorseRed(id);
        }
    }
    //升星和解锁共用红点
    void RefreshStarRedpoint(int itemID)
    {
        int activeID = unLockSkinItems[itemID];
        int horseID = HorseConfig.GetItemUnLockHorse(itemID);
        if (!HorseStarUpConfig.horseIDToIDs.ContainsKey(horseID))
            return;
        if (!isMountSkinActive(horseID))
            return;
        DeblockingRedPoint[activeID].state = RedPointState.None;
        int star = 0;
        horseStarDict.TryGetValue(horseID, out star);
        //满星
        if (star == HorseStarUpConfig.horseIDToIDs[horseID].Count)
            return;
        var id = HorseStarUpConfig.horseIDToIDs[horseID][star];
        var nextStarConfig = HorseStarUpConfig.Get(id);
        List<int[]> awards = nextStarConfig.StarUpNeedItemList;
        for (int i = 0; i < awards.Count; i++)
        {
            if (playerPack.GetItemCountByID(PackType.Item, awards[i][0]) < awards[i][1])
                return;
        }
        DeblockingRedPoint[activeID].state = RedPointState.Simple;
    }
    //private void OnFuncStateChangeEvent(int funcId)
@@ -418,7 +391,7 @@
        }
        
    }
    private void MountStoneRed()//坐骑魂石红点
    public void MountStoneRed()//坐骑魂石红点
    {
        redPointStre2.state = RedPointState.None;
        if (!FuncOpen.Instance.IsFuncOpen(8))
@@ -458,39 +431,6 @@
    }
    private int GetRedPointMountID(List<int> MountList)
    {
        int GetSkillMinLv = 999;
        for (int i = 0; i < MountList.Count; i++)
        {
            int SkillminLv = GetSkillLvDis(MountList[i]);
            if (SkillminLv < GetSkillMinLv && SkillminLv != 0)
            {
                GetSkillMinLv = SkillminLv;
            }
        }
        int mountId = 0;
        int ExpNumber = 999999999;
        for (int i = 0; i < MountList.Count; i++)
        {
            int SkillLv = GetSkillLvDis(MountList[i]);
            if (SkillLv > GetSkillMinLv || SkillLv == 0)
            {
                continue;
            }
            var Hor1 = HorseUpConfig.GetHorseIDAndLV(MountList[i], SkillLv);
            var Hor2 = HorseUpConfig.GetHorseIDAndLV(MountList[i], _DicHorse[(MountList[i])].Lv);
            int Exp = Hor1.NeedExpTotal - Hor2.NeedExpTotal - _DicHorse[(MountList[i])].Exp;
            if (Exp < ExpNumber)
            {
                ExpNumber = Exp;
                mountId = MountList[i];
            }
        }
        return mountId;
    }
    private int GetSkillLvDis(int MountId)//获取离升级最近的技能等级
    {
@@ -670,15 +610,7 @@
        else
        {
            int _AttT = 0;//攻击
            foreach (int key in _DicHorse.Keys)
            {
                HorseUpConfig tagMode = HorseUpConfig.GetHorseIDAndLV(key, _DicHorse[key].Lv);
                int[] intAttrValue = tagMode.AttrValue;
                if (intAttrValue.Length != 0)
                {
                    _AttT += intAttrValue[1];
                }
            }
            return _AttT + dicStone[7];
        }
    }
@@ -1113,4 +1045,39 @@
            RankHorseIDList.Add(horseConfig.HorseID);
        }
    }
    //坐骑幻化升星
    public void UpdateHorseStarInfo(HA3CD_tagMCHorseStarInfo netPack)
    {
        for (int i = 0; i < netPack.HorseStarList.Length; i++)
        {
            horseStarDict[(int)netPack.HorseStarList[i].HorseID] = netPack.HorseStarList[i].Star;
        }
        onMountSkinActive?.Invoke();
        foreach (var id in unLockSkinItems.Keys)
        {
            RefreshStarRedpoint(id);
        }
    }
    //坐骑幻化物品是否可用于觉醒
    public bool IsHorseSkinCanAwake(int horseID)
    {
        if (!isMountSkinActive(horseID))
        {
            return false;
        }
        if (!HorseStarUpConfig.horseIDToIDs.ContainsKey(horseID))
            return true;
        int star = 0;
        horseStarDict.TryGetValue(horseID, out star);
        //满星
        if (star != HorseStarUpConfig.horseIDToIDs[horseID].Count)
            return false;
        return true;
    }
}
System/Mount/MountSkinWin.cs
@@ -1,376 +1,537 @@
//--------------------------------------------------------
//    [Author]:           第二世界
//    [  Date ]:           Friday, January 05, 2018
//--------------------------------------------------------
using Snxxz.UI;
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
//坐骑面板
namespace Snxxz.UI
{
    public class MountSkinWin : Window, SecondWindowInterface
    {
        [SerializeField] ScrollerController m_ScrollerController;
        [SerializeField] Button m_DeblockingBtton;//解锁按钮
        [SerializeField] Button m_RideBtton;//骑乘
        [SerializeField] RawImage m_Mount3D;
        [SerializeField] Text m_FightPower;
        [SerializeField] Text m_MountName;//被选中的坐骑名
        [SerializeField] ItemCell MountItem;
        [SerializeField] Text MountItemName;
        [SerializeField] List<Text> AttrNameList;
        [SerializeField] List<Text> AttrValueList;
        List<Int3> sortMountlist = new List<Int3>();//坐骑顺序排列
        public int signHorseID = 0;//用来标记坐骑ID
        public Button close { get; set; }
        #region Built-in
        PackModel _playerPack;
        PackModel playerPack { get { return _playerPack ?? (_playerPack = ModelCenter.Instance.GetModel<PackModel>()); } }
        MountModel m_MountModel;
        MountModel mountModel { get { return m_MountModel ?? (m_MountModel = ModelCenter.Instance.GetModel<MountModel>()); } }
        RidingAndPetActivationModel ridingAndPetActivationModel { get { return ModelCenter.Instance.GetModel<RidingAndPetActivationModel>(); } }
        protected override void BindController()
        {
            if (this is SecondWindowInterface)
            {
                var frame = this.GetComponentInChildren<SecondFrameLoader>();
                frame.Create();
                close = frame.GetComponentInChildren<Button>();
            }
        }
        protected override void AddListeners()
        {
            m_DeblockingBtton.SetListener(OnClickDeblockingBtton);
            close.SetListener(() =>
            {
                CloseClick();
                WindowCenter.Instance.Open<PetWin>(false, 0);
            });
            m_RideBtton.SetListener(() => {
                mountModel.AppearanceSwitch((byte)mountModel.mountSkin[signHorseID], 2);
            });
        }
        private void onMountSkinActive()
        {
            m_ScrollerController.m_Scorller.RefreshActiveCellViews();//刷新可见
            RefreshMountSkinPanel();
            ridingAndPetActivationModel.RidingAndPetActivationSet(RidingAndPetActivation.MountActivation, signHorseID);
            sortMountlist.Clear();
            ToAddSorting();
        }
        protected override void OnPreOpen()
        {
            MountModel.Event_MountHA301A += OnMountSkinAdd;
            m_ScrollerController.OnRefreshCell += OnRefreshGridCell;
            mountModel.onMountSkinActive += onMountSkinActive;
            MountModel.Event_MountAlteration += Event_MountAlteration;
            ToAddSorting();
            int jumpIndex = JumpSelect(OpenChooseIndex());
            OnCreateGridLineCell(m_ScrollerController);
            m_ScrollerController.JumpIndex(JumpSelect(jumpIndex));
            RefreshMountSkinPanel();
        }
        protected override void OnActived()
        {
            base.OnActived();
        }
        protected override void OnAfterOpen()
        {
        }
        protected override void OnPreClose()
        {
            MountModel.Event_MountHA301A -= OnMountSkinAdd;
            m_ScrollerController.OnRefreshCell -= OnRefreshGridCell;
            mountModel.onMountSkinActive -= onMountSkinActive;
            MountModel.Event_MountAlteration -= Event_MountAlteration;
            UI3DModelExhibition.Instance.StopShow();
            signHorseID = 0;
        }
        protected override void OnAfterClose()
        {
        }
        private int JumpIndex(int HorseID = 0)
        {
            int Index = 0;
            Index = sortMountlist.FindIndex((x) =>
            {
                return x.x == signHorseID;
            });
            if (Index == -1)
            {
                Index = 0;
            }
            return JumpSelect(Index);
        }
        private int OpenChooseIndex()
        {
            // 红点-骑乘中-第一个
            int selectIndex = 0;
            int ridingHorseSkinID = -1;
            if (mountModel.mountSkin.ContainsKey(mountModel.HorseIDNow))
            {
                ridingHorseSkinID = mountModel.mountSkin[mountModel.HorseIDNow];
            }
            int index = 0;
            foreach (var sortInfo in sortMountlist)
            {
                if (ridingHorseSkinID != -1 && ridingHorseSkinID == sortInfo[0])
                {
                    selectIndex = index;
                }
                if (mountModel.DeblockingRedPoint[sortInfo[0]].state != RedPointState.None)
                {
                    signHorseID = HorseSkinPlusConfig.Get(sortInfo[0]).HorseID;
                    return index;
                }
                index++;
            }
            signHorseID = HorseSkinPlusConfig.Get(sortMountlist[selectIndex][0]).HorseID;
            return selectIndex;
        }
        void OnCreateGridLineCell(ScrollerController gridCtrl)
        {
            gridCtrl.Refresh();
            for (int i = 0; i < sortMountlist.Count; i++)
            {
                gridCtrl.AddCell(ScrollerDataType.Header, HorseSkinPlusConfig.Get(sortMountlist[i].x).HorseID);
            }
            gridCtrl.Restart();
        }
        private void OnRefreshGridCell(ScrollerDataType type, CellView cell)
        {
            SelectThemount selectThemount = cell.GetComponent<SelectThemount>();
            int horseID = cell.index;
            var horseConfig = HorseConfig.Get(horseID);
            selectThemount.QualityTxt1.text = ProductOrder(horseConfig.Quality.ToString());
            selectThemount.MountNameTxt.text = horseConfig.Name;
            selectThemount.MountLvActivation.SetActive(!mountModel.isMountSkinActive(horseID));
            if (horseID == signHorseID)
            {
                selectThemount.ChoosenImg.SetActive(true);
                selectThemount.DarkImage.SetActive(false);
            }
            else
            {
                selectThemount.ChoosenImg.SetActive(false);
                selectThemount.DarkImage.SetActive(true);
            }
            selectThemount.HidingTips.SetActive(mountModel.HorseIDNow == horseID ? true : false);
            selectThemount.MountButton.SetListener(()=> {
                if (signHorseID == horseID)
                    return;
                signHorseID = horseID;
                m_ScrollerController.m_Scorller.RefreshActiveCellViews();//刷新可见
                RefreshMountSkinPanel();
            });
            selectThemount.RedPoint.redpointId = mountModel.DeblockingRedPoint[mountModel.mountSkin[horseID]].id;
        }
        private void RefreshMountSkinPanel()
        {
            if (signHorseID == 0)
                return;
            HorseConfig _model = HorseConfig.Get(signHorseID);
            m_MountName.text = _model.Name;
            if (!m_Mount3D.gameObject.activeSelf)
            {
                m_Mount3D.SetActive(true);
            }
            UI3DModelExhibition.Instance.ShowHourse(_model.Model, m_Mount3D);
            if (UI3DModelExhibition.Instance.NpcModelHorse != null)
            {
                var animator = UI3DModelExhibition.Instance.NpcModelHorse.GetComponent<Animator>();
                if (animator != null)
                {
                    animator.Play(GAStaticDefine.State_Dance);
                }
            }
            ShowAttrText();
            DisplayButton();
        }
        private void Event_MountAlteration()
        {
            DisplayButton();
            m_ScrollerController.m_Scorller.RefreshActiveCellViews();//刷新可见
        }
        private void DisplayButton()
        {
            if (mountModel.isMountSkinActive(signHorseID))
            {
                m_DeblockingBtton.SetActive(false);
                m_RideBtton.SetActive(true);
                if (signHorseID == mountModel.HorseIDNow)
                {
                    m_RideBtton.SetActive(false);
                }
                return;
            }
            //AppearanceSwitch
            HorseConfig horsefig = HorseConfig.Get(signHorseID);
            ItemCellModel cellModel = new ItemCellModel(horsefig.UnlockItemID, false, 1);
            MountItem.Init(cellModel);
            MountItem.countText.SetActive(true);
            MountItem.countText.text = playerPack.GetItemCountByID(PackType.Item, horsefig.UnlockItemID).ToString();
            var itemConfig = ItemConfig.Get(horsefig.UnlockItemID);
            MountItemName.text = UIHelper.AppendColor(itemConfig.ItemColor, itemConfig.ItemName);
            MountItem.button.SetListener(() =>
            {
                ItemTipUtility.Show(horsefig.UnlockItemID);
            });
            m_DeblockingBtton.SetActive(true);
            m_RideBtton.SetActive(false);
        }
        private void ShowAttrText()
        {
            ClearAttrText();
            var config = HorseSkinPlusConfig.Get(mountModel.mountSkin[signHorseID]);
            int showIndex = 0;
            Dictionary<int, int> allAttr = new Dictionary<int, int>();
            foreach (var attrID in config.AttrType)
            {
                allAttr[attrID] = config.AttrValue[showIndex];
                AttrNameList[showIndex].text = PlayerPropertyConfig.Get(attrID).ShowName;
                AttrValueList[showIndex].text = PlayerPropertyConfig.GetValueDescription(attrID, config.AttrValue[showIndex]);
                showIndex++;
            }
            m_FightPower.text = (UIHelper.GetFightPower(allAttr) + config.InitFightPower).ToString();
        }
        private void ClearAttrText()
        {
            for (int i = 0; i < AttrNameList.Count; i++)
            {
                AttrNameList[i].text = string.Empty;
                AttrValueList[i].text = string.Empty;
            }
        }
        private void OnClickDeblockingBtton()//解锁按钮
        {
            HorseConfig horsefig = HorseConfig.Get(signHorseID);
            int MaterialNumber = playerPack.GetItemCountByID(PackType.Item, horsefig.UnlockItemID);//获取背包解锁材料的数量
            if (MaterialNumber >= horsefig.UnlockItemCnt)
            {
                CA501_tagPlayerActivateHorse _tagA501 = new CA501_tagPlayerActivateHorse();
                _tagA501.HorseID = (uint)mountModel.mountSkin[signHorseID];
                GameNetSystem.Instance.SendInfo(_tagA501);
            }
            else
            {
                ScrollTip.ShowTip(Language.Get("Z1063"));//所需材料不足
            }
        }
        #endregion
        void ToAddSorting()//坐骑的列表排序
        {
            if (sortMountlist.Count <= 0)
            {
                foreach (var mountSkin in mountModel.MountSkinActive)
                {
                    var config = HorseSkinPlusConfig.Get(mountSkin.Key);
                    sortMountlist.Add(new Int3(mountSkin.Key, mountSkin.Value, config.sortIndex));
                }
            }
            sortMountlist.Sort(Compare);
        }
        int Compare(Int3 skin1, Int3 skin2)//数组排列
        {
            var xActive = skin1.y;
            var yActive = skin2.y;
            if (xActive != yActive)
            {
                return yActive.CompareTo(xActive);
            }
            return skin1.z.CompareTo(skin2.z);
        }
        string ProductOrder(string _petProductOrder)//坐骑品质
        {
            FuncConfigConfig _PetQuality = FuncConfigConfig.Get("PetQuality");
            string[] _productlist = _PetQuality.Numerical1.Split('|');
            for (int i = 0; i < _productlist.Length; i++)
            {
                if (_petProductOrder == _productlist[i])
                {
                    string[] _productText = _PetQuality.Numerical2.Split('|');
                    string str = _productText[i];
                    return str;
                }
            }
            return null;
        }
        private int JumpSelect(int Index)
        {
            if (Index <= 4)
            {
                return 0;
            }
            return Index;
        }
        private void OnMountSkinAdd(int id)
        {
        }
    }
}
//--------------------------------------------------------
//    [Author]:           第二世界
//    [  Date ]:           Friday, January 05, 2018
//--------------------------------------------------------
using LitJson;
using Snxxz.UI;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using UnityEngine;
using UnityEngine.UI;
//坐骑面板
namespace Snxxz.UI
{
    public class MountSkinWin : Window, SecondWindowInterface
    {
        [SerializeField] ScrollerController m_ScrollerController;
        [SerializeField] Button m_DeblockingBtton;//解锁按钮
        [SerializeField] Button m_RideBtton;//骑乘
        [SerializeField] RawImage m_Mount3D;
        [SerializeField] Text m_FightPower;
        [SerializeField] Text m_MountName;//被选中的坐骑名
        [SerializeField] ItemCell MountItem;
        [SerializeField] Text MountItemName;
        [SerializeField] List<Text> AttrNameList;
        [SerializeField] List<Text> AttrValueList;
        [SerializeField] Transform starUpObj;
        [SerializeField] List<Transform> starsObj;
        [SerializeField] List<ItemCell> itemCells;
        [SerializeField] ButtonEx starUpBtn;
        [SerializeField] Transform maxObj;
        [SerializeField] UIEffect starEffect;
        List<Int3> sortMountlist = new List<Int3>();//坐骑顺序排列
        public int signHorseID = 0;//用来标记坐骑ID
        public Button close { get; set; }
        #region Built-in
        PackModel _playerPack;
        PackModel playerPack { get { return _playerPack ?? (_playerPack = ModelCenter.Instance.GetModel<PackModel>()); } }
        MountModel m_MountModel;
        MountModel mountModel { get { return m_MountModel ?? (m_MountModel = ModelCenter.Instance.GetModel<MountModel>()); } }
        RidingAndPetActivationModel ridingAndPetActivationModel { get { return ModelCenter.Instance.GetModel<RidingAndPetActivationModel>(); } }
        protected override void BindController()
        {
            if (this is SecondWindowInterface)
            {
                var frame = this.GetComponentInChildren<SecondFrameLoader>();
                frame.Create();
                close = frame.GetComponentInChildren<Button>();
            }
        }
        protected override void AddListeners()
        {
            m_DeblockingBtton.SetListener(OnClickDeblockingBtton);
            close.SetListener(() =>
            {
                CloseClick();
                WindowCenter.Instance.Open<PetWin>(false, 0);
            });
            m_RideBtton.SetListener(() => {
                mountModel.AppearanceSwitch((byte)mountModel.mountSkin[signHorseID], 2);
            });
        }
        private void onMountSkinActive()
        {
            m_ScrollerController.m_Scorller.RefreshActiveCellViews();//刷新可见
            RefreshMountSkinPanel();
            if (mountModel.horseStarDict.ContainsKey(signHorseID) && mountModel.horseStarDict[signHorseID] > 0)
            {
                starEffect.Play();
            }
            else
            {
                ridingAndPetActivationModel.RidingAndPetActivationSet(RidingAndPetActivation.MountActivation, signHorseID);
            }
            sortMountlist.Clear();
            ToAddSorting();
        }
        protected override void OnPreOpen()
        {
            MountModel.Event_MountHA301A += OnMountSkinAdd;
            m_ScrollerController.OnRefreshCell += OnRefreshGridCell;
            mountModel.onMountSkinActive += onMountSkinActive;
            MountModel.Event_MountAlteration += Event_MountAlteration;
            ToAddSorting();
            int jumpIndex = JumpSelect(OpenChooseIndex());
            OnCreateGridLineCell(m_ScrollerController);
            m_ScrollerController.JumpIndex(JumpSelect(jumpIndex));
            RefreshMountSkinPanel();
        }
        protected override void OnActived()
        {
            base.OnActived();
        }
        protected override void OnAfterOpen()
        {
        }
        protected override void OnPreClose()
        {
            MountModel.Event_MountHA301A -= OnMountSkinAdd;
            m_ScrollerController.OnRefreshCell -= OnRefreshGridCell;
            mountModel.onMountSkinActive -= onMountSkinActive;
            MountModel.Event_MountAlteration -= Event_MountAlteration;
            UI3DModelExhibition.Instance.StopShow();
            signHorseID = 0;
        }
        protected override void OnAfterClose()
        {
        }
        private int JumpIndex(int HorseID = 0)
        {
            int Index = 0;
            Index = sortMountlist.FindIndex((x) =>
            {
                return x.x == signHorseID;
            });
            if (Index == -1)
            {
                Index = 0;
            }
            return JumpSelect(Index);
        }
        private int OpenChooseIndex()
        {
            // 红点-骑乘中-第一个
            int selectIndex = 0;
            int ridingHorseSkinID = -1;
            if (mountModel.mountSkin.ContainsKey(mountModel.HorseIDNow))
            {
                ridingHorseSkinID = mountModel.mountSkin[mountModel.HorseIDNow];
            }
            int index = 0;
            foreach (var sortInfo in sortMountlist)
            {
                if (ridingHorseSkinID != -1 && ridingHorseSkinID == sortInfo[0])
                {
                    selectIndex = index;
                }
                if (mountModel.DeblockingRedPoint[sortInfo[0]].state != RedPointState.None)
                {
                    signHorseID = HorseSkinPlusConfig.Get(sortInfo[0]).HorseID;
                    return index;
                }
                index++;
            }
            signHorseID = HorseSkinPlusConfig.Get(sortMountlist[selectIndex][0]).HorseID;
            return selectIndex;
        }
        void OnCreateGridLineCell(ScrollerController gridCtrl)
        {
            gridCtrl.Refresh();
            for (int i = 0; i < sortMountlist.Count; i++)
            {
                gridCtrl.AddCell(ScrollerDataType.Header, HorseSkinPlusConfig.Get(sortMountlist[i].x).HorseID);
            }
            gridCtrl.Restart();
        }
        private void OnRefreshGridCell(ScrollerDataType type, CellView cell)
        {
            SelectThemount selectThemount = cell.GetComponent<SelectThemount>();
            int horseID = cell.index;
            var horseConfig = HorseConfig.Get(horseID);
            selectThemount.QualityTxt1.text = ProductOrder(horseConfig.Quality.ToString());
            selectThemount.MountNameTxt.text = horseConfig.Name;
            selectThemount.MountLvActivation.SetActive(!mountModel.isMountSkinActive(horseID));
            int star = 0;
            mountModel.horseStarDict.TryGetValue(horseID, out star);
            for (int i = 0; i < selectThemount.starsImg.Count; i++)
            {
                selectThemount.starsImg[i].SetActive(i < star);
            }
            if (horseID == signHorseID)
            {
                selectThemount.ChoosenImg.SetActive(true);
                selectThemount.DarkImage.SetActive(false);
            }
            else
            {
                selectThemount.ChoosenImg.SetActive(false);
                selectThemount.DarkImage.SetActive(true);
            }
            selectThemount.HidingTips.SetActive(mountModel.HorseIDNow == horseID ? true : false);
            selectThemount.MountButton.SetListener(()=> {
                if (signHorseID == horseID)
                    return;
                signHorseID = horseID;
                m_ScrollerController.m_Scorller.RefreshActiveCellViews();//刷新可见
                RefreshMountSkinPanel();
            });
            selectThemount.RedPoint.redpointId = mountModel.DeblockingRedPoint[mountModel.mountSkin[horseID]].id;
        }
        private void RefreshMountSkinPanel()
        {
            if (signHorseID == 0)
                return;
            HorseConfig _model = HorseConfig.Get(signHorseID);
            m_MountName.text = _model.Name;
            if (!m_Mount3D.gameObject.activeSelf)
            {
                m_Mount3D.SetActive(true);
            }
            UI3DModelExhibition.Instance.ShowHourse(_model.Model, m_Mount3D);
            if (UI3DModelExhibition.Instance.NpcModelHorse != null)
            {
                var animator = UI3DModelExhibition.Instance.NpcModelHorse.GetComponent<Animator>();
                if (animator != null)
                {
                    animator.Play(GAStaticDefine.State_Dance);
                }
            }
            ShowAttrText();
            DisplayButton();
        }
        private void Event_MountAlteration()
        {
            DisplayButton();
            m_ScrollerController.m_Scorller.RefreshActiveCellViews();//刷新可见
        }
        private void DisplayButton()
        {
            if (mountModel.isMountSkinActive(signHorseID))
            {
                m_DeblockingBtton.SetActive(false);
                m_RideBtton.SetActive(true);
                if (signHorseID == mountModel.HorseIDNow)
                {
                    m_RideBtton.SetActive(false);
                }
                if (HorseStarUpConfig.horseIDToIDs.ContainsKey(signHorseID))
                {
                    starUpObj.SetActive(true);
                    int star = 0;
                    mountModel.horseStarDict.TryGetValue(signHorseID, out star);
                    int maxStar = HorseStarUpConfig.horseIDToIDs[signHorseID].Count;
                    for (int i = 0; i < starsObj.Count; i++)
                    {
                        if (i < maxStar)
                        {
                            starsObj[i].SetActive(true);
                            starsObj[i].FindComponent("Image", "Img_Star_True").SetActive(i < star);
                        }
                        else
                        {
                            starsObj[i].SetActive(false);
                        }
                    }
                    List<int[]> awards = new List<int[]>();
                    if (star != maxStar)
                    {
                        var id = HorseStarUpConfig.horseIDToIDs[signHorseID][star];
                        var nextStarConfig = HorseStarUpConfig.Get(id);
                        awards = nextStarConfig.StarUpNeedItemList;
                    }
                    for (int i = 0; i < itemCells.Count; i++)
                    {
                        if (i < awards.Count)
                        {
                            itemCells[i].SetActive(true);
                            int itemID = awards[i][0];
                            int needCnt = awards[i][1];
                            int hasCnt = playerPack.GetItemCountByID(PackType.Item, itemID);
                            itemCells[i].Init(new ItemCellModel(itemID, false, 1));
                            itemCells[i].button.AddListener(() =>
                            {
                                ItemTipUtility.Show(itemID);
                            });
                            var cntTxt = itemCells[i].FindComponent("Text", "count") as Text;
                            if (hasCnt >= needCnt)
                            {
                                cntTxt.text = UIHelper.AppendColor(TextColType.Green, hasCnt.ToString()) + "/" + needCnt.ToString();
                            }
                            else
                            {
                                cntTxt.text = UIHelper.AppendColor(TextColType.Red, hasCnt.ToString()) + "/" + needCnt.ToString();
                            }
                        }
                        else
                        {
                            itemCells[i].SetActive(false);
                        }
                    }
                    starUpBtn.SetActive(star != maxStar);
                    maxObj.SetActive(star == maxStar);
                    starUpBtn.AddListener(() =>
                    {
                        if (star < maxStar)
                            starsObj[star].GetComponent<UIEffect>().Play();
                        CA535_tagCMHorseStarUp pak = new CA535_tagCMHorseStarUp();
                        pak.HorseID = (uint)signHorseID;
                        GameNetSystem.Instance.SendInfo(pak);
                    });
                }
                else
                {
                    starUpObj.SetActive(false);
                }
                return;
            }
            //AppearanceSwitch
            HorseConfig horsefig = HorseConfig.Get(signHorseID);
            ItemCellModel cellModel = new ItemCellModel(horsefig.UnlockItemID, false, 1);
            MountItem.Init(cellModel);
            MountItem.countText.SetActive(true);
            MountItem.countText.text = playerPack.GetItemCountByID(PackType.Item, horsefig.UnlockItemID).ToString();
            var itemConfig = ItemConfig.Get(horsefig.UnlockItemID);
            MountItemName.text = UIHelper.AppendColor(itemConfig.ItemColor, itemConfig.ItemName);
            MountItem.button.SetListener(() =>
            {
                ItemTipUtility.Show(horsefig.UnlockItemID);
            });
            m_DeblockingBtton.SetActive(true);
            m_RideBtton.SetActive(false);
            starUpObj.SetActive(false);
        }
        private void ShowAttrText()
        {
            ClearAttrText();
            var config = HorseSkinPlusConfig.Get(mountModel.mountSkin[signHorseID]);
            int showIndex = 0;
            Dictionary<int, int> allAttr = new Dictionary<int, int>();
            foreach (var attrID in config.AttrType)
            {
                allAttr[attrID] = config.AttrValue[showIndex];
                AttrNameList[showIndex].text = PlayerPropertyConfig.Get(attrID).ShowName;
                AttrValueList[showIndex].text = PlayerPropertyConfig.GetValueDescription(attrID, config.AttrValue[showIndex]);
                showIndex++;
            }
            int star = 0;
            mountModel.horseStarDict.TryGetValue(signHorseID, out star);
            Dictionary<int, int> addAttr = new Dictionary<int, int>();
            if (HorseStarUpConfig.horseIDToIDs.ContainsKey(signHorseID))
            {
                int[] starTypeArr = new int[] { };
                int[] starValueArr = new int[] { };
                if (star > 0)
                {
                    var id = HorseStarUpConfig.horseIDToIDs[signHorseID][star - 1];
                    var starConfig = HorseStarUpConfig.Get(id);
                    showIndex = 0;
                    starTypeArr = starConfig.StarAttrType;
                    starValueArr = starConfig.StarAttrValue;
                    foreach (var attrID in starTypeArr)
                    {
                        if (allAttr.ContainsKey(attrID))
                        {
                            allAttr[attrID] = allAttr[attrID] + starValueArr[showIndex];
                        }
                        else
                        {
                            allAttr[attrID] = starValueArr[showIndex];
                        }
                        showIndex++;
                    }
                }
                if (star < HorseStarUpConfig.horseIDToIDs[signHorseID].Count)
                {
                    var id = HorseStarUpConfig.horseIDToIDs[signHorseID][star];
                    var nextStarConfig = HorseStarUpConfig.Get(id);
                    for (int i = 0; i < nextStarConfig.StarAttrType.Length; i++)
                    {
                        if (!allAttr.ContainsKey(nextStarConfig.StarAttrType[i]))
                        {
                            //预览用
                            allAttr[nextStarConfig.StarAttrType[i]] = 0;
                        }
                        if (Array.IndexOf(starTypeArr, nextStarConfig.StarAttrType[i]) >= 0)
                        {
                            addAttr[nextStarConfig.StarAttrType[i]] = nextStarConfig.StarAttrValue[i] - starValueArr[i];
                        }
                        else
                        {
                            addAttr[nextStarConfig.StarAttrType[i]] = nextStarConfig.StarAttrValue[i];
                        }
                    }
                }
            }
            showIndex = 0;
            foreach (var attrID in allAttr.Keys)
            {
                AttrNameList[showIndex].text = PlayerPropertyConfig.Get(attrID).ShowName;
                if (addAttr.ContainsKey(attrID))
                {
                    AttrValueList[showIndex].text = PlayerPropertyConfig.GetValueDescription(attrID, allAttr[attrID]) + UIHelper.AppendColor(TextColType.Green, string.Format(" +{0}", PlayerPropertyConfig.GetValueDescription(attrID, addAttr[attrID])));
                }
                else
                {
                    AttrValueList[showIndex].text = PlayerPropertyConfig.GetValueDescription(attrID, allAttr[attrID]);
                }
                showIndex++;
            }
            m_FightPower.text = (UIHelper.GetFightPower(allAttr) + config.InitFightPower).ToString();
        }
        private void ClearAttrText()
        {
            for (int i = 0; i < AttrNameList.Count; i++)
            {
                AttrNameList[i].text = string.Empty;
                AttrValueList[i].text = string.Empty;
            }
        }
        private void OnClickDeblockingBtton()//解锁按钮
        {
            HorseConfig horsefig = HorseConfig.Get(signHorseID);
            int MaterialNumber = playerPack.GetItemCountByID(PackType.Item, horsefig.UnlockItemID);//获取背包解锁材料的数量
            if (MaterialNumber >= horsefig.UnlockItemCnt)
            {
                CA501_tagPlayerActivateHorse _tagA501 = new CA501_tagPlayerActivateHorse();
                _tagA501.HorseID = (uint)mountModel.mountSkin[signHorseID];
                GameNetSystem.Instance.SendInfo(_tagA501);
            }
            else
            {
                ScrollTip.ShowTip(Language.Get("Z1063"));//所需材料不足
            }
        }
        #endregion
        void ToAddSorting()//坐骑的列表排序
        {
            if (sortMountlist.Count <= 0)
            {
                foreach (var mountSkin in mountModel.MountSkinActive)
                {
                    var config = HorseSkinPlusConfig.Get(mountSkin.Key);
                    sortMountlist.Add(new Int3(mountSkin.Key, mountSkin.Value, config.sortIndex));
                }
            }
            sortMountlist.Sort(Compare);
        }
        int Compare(Int3 skin1, Int3 skin2)//数组排列
        {
            var xActive = skin1.y;
            var yActive = skin2.y;
            if (xActive != yActive)
            {
                return yActive.CompareTo(xActive);
            }
            return skin1.z.CompareTo(skin2.z);
        }
        string ProductOrder(string _petProductOrder)//坐骑品质
        {
            FuncConfigConfig _PetQuality = FuncConfigConfig.Get("PetQuality");
            string[] _productlist = _PetQuality.Numerical1.Split('|');
            for (int i = 0; i < _productlist.Length; i++)
            {
                if (_petProductOrder == _productlist[i])
                {
                    string[] _productText = _PetQuality.Numerical2.Split('|');
                    string str = _productText[i];
                    return str;
                }
            }
            return null;
        }
        private int JumpSelect(int Index)
        {
            if (Index <= 4)
            {
                return 0;
            }
            return Index;
        }
        private void OnMountSkinAdd(int id)
        {
        }
    }
}
System/Mount/SelectThemount.cs
@@ -5,6 +5,7 @@
using UnityEngine;
using System.Collections;
using UnityEngine.UI;
using System.Collections.Generic;
namespace Snxxz.UI {
@@ -61,6 +62,13 @@
            get { return m_QualityTxt1; }
            set { m_QualityTxt1 = value; }
        }
        [SerializeField] List<Image> m_starsImg;//星级
        public List<Image> starsImg
        {
            get { return m_starsImg; }
            set { starsImg = value; }
        }
    }
}
System/Pet/RidingAndPetActivationModel.cs
@@ -294,22 +294,6 @@
        private Dictionary<int, float> GetMountProperty(int mountID, int ValueKey, int Value)
        {
            Dictionary<int, float> DicSkill = new Dictionary<int, float>();
            DicSkill.Add(6, 0f);
            DicSkill.Add(7, 0f);
            if (mountModel._DicHorse.ContainsKey(mountID))
            {
                HorseUpConfig tagMode = HorseUpConfig.GetHorseIDAndLV(mountID, mountModel._DicHorse[mountID].Lv);
                int[] attrType = tagMode.AttrType;
                int[] attrValue = tagMode.AttrValue;
                for (int i = 0; i < attrType.Length; i++)
                {
                    if (attrType[i] == ValueKey && DicSkill.ContainsKey(ValueKey))
                    {
                        DicSkill[ValueKey] = (float)attrValue[i] * ((float)Value / 10000);
                    }
                }
                return DicSkill;
            }
            return DicSkill;
        }
        public Dictionary<int, float> GetOneMountProperty(int MountID)//获取单只坐骑的技能属性加成
@@ -409,29 +393,7 @@
        private Dictionary<int, float> GetMountPropertyQuality(int Quality, int ValueKey, int Value)
        {
            Dictionary<int, float> DicSkill = new Dictionary<int, float>();
            DicSkill.Add(6, 0f);
            DicSkill.Add(7, 0f);
            if (mountModel._DicHorse.Count > 0)
            {
                foreach (var key in mountModel._DicHorse.Keys)
                {
                    HorseConfig horseConfig = HorseConfig.Get(key);
                    if (horseConfig.Quality == Quality)
                    {
                        HorseUpConfig tagMode = HorseUpConfig.GetHorseIDAndLV(key, mountModel._DicHorse[key].Lv);
                        int[] attrType = tagMode.AttrType;
                        int[] attrValue =tagMode.AttrValue;
                        for (int i = 0; i < attrType.Length; i++)
                        {
                            if (attrType[i] == ValueKey && DicSkill.ContainsKey(ValueKey))
                            {
                                DicSkill[ValueKey] += (float)attrValue[i] * ((float)Value / 10000);
                            }
                        }
                    }
                }
                return DicSkill;
            }
            return DicSkill;
        }
        public Dictionary<int, float> GetOneMountPropertyQuality(int MountID)//根据品质获取单只坐骑的技能属性加成
System/Pet/TargetPetAttrWin.cs
@@ -88,7 +88,6 @@
            switch (propertyTip)
            {
                case PropertyTip.Mount:
                    CurMountAttrCtrl(Id);
                    break;
                case PropertyTip.Pet:
                    CurPetAttrCtrl();
@@ -168,98 +167,6 @@
                }
                _scoreNumAll1 = Mathf.FloorToInt(_tagPetClassNext.AtkAdd * 2.5f) + _scoreNum1;
                curPetAttackText1.text = _scoreNumAll1.ToString();
            }
        }
        List<HorseSkillClass> MountSkills = new List<HorseSkillClass>();
        private void CurMountAttrCtrl(int ID)
        {
            MountSkills.Clear();
            foreach (var key in mountModel.GetMountSkillAndItem.Keys)
            {
                if (mountModel.GetMountSkillAndItem[key].HorseID == ID)
                {
                    MountSkills.Add(mountModel.GetMountSkillAndItem[key]);
                }
            }
            NowAttTipPet1.SetActive(false);
            NowAttTipPet.SetActive(false);
            NowAttTipMount.SetActive(true);
            NowAttTipMount1.SetActive(true);
            HorseConfig horseconfig = HorseConfig.Get(ID);
            HorseUpConfig horseUpconfig = HorseUpConfig.GetHorseIDAndLV(ID, mountModel._DicHorse[ID].Lv);
            m_Property_Text.text = Language.Get("MountAttributes_Z");
            m_LVtextP.text = mountModel._DicHorse[ID].Lv + Language.Get("Z1041");
            int[] strAttrValue = horseUpconfig.AttrValue;
            Dictionary<int, int> AddPowerDic = new Dictionary<int, int>();
            AddPowerDic.Clear();
            if (strAttrValue.Length != 0)
            {
                curMountLifeText.text = strAttrValue[0].ToString();//生命
                curMountAttackText.text = strAttrValue[1].ToString();//攻击
                curMountSpeedText.text = strAttrValue[2].ToString();//速度
                AddPowerDic.Add(6, strAttrValue[0]);
                AddPowerDic.Add(7, strAttrValue[1]);
            }
            int _scoreNum = 0;
            int _scoreNumAll = 0;
            for (int i = 0; i < MountSkills.Count; i++)
            {
                if (mountModel._DicHorse[ID].Lv >= MountSkills[i].HorseLV)
                {
                    SkillConfig skillconfig = SkillConfig.Get(MountSkills[i].SkillID);
                    if (skillconfig != null)
                    {
                        _scoreNum += skillconfig.FightPower;
                    }
                }
            }
            _scoreNumAll = UIHelper.GetFightPower(AddPowerDic) + _scoreNum;
            curMountFightingText.text = _scoreNumAll.ToString();
            if (mountModel._DicHorse[ID].Lv >= horseconfig.MaxLV)
            {
                m_LVtextP1.transform.parent.SetActive(false);
                curMountFightingText1.transform.parent.SetActive(false);
                curMountLifeText1.transform.parent.SetActive(false);
                curMountAttackText1.transform.parent.SetActive(false);
                curMountSpeedText1.transform.parent.SetActive(false);
                m_ManJiImage.SetActive(true);
            }
            else
            {
                m_ManJiImage.SetActive(false);
                m_LVtextP1.transform.parent.SetActive(true);
                curMountFightingText1.transform.parent.SetActive(true);
                curMountLifeText1.transform.parent.SetActive(true);
                curMountAttackText1.transform.parent.SetActive(true);
                curMountSpeedText1.transform.parent.SetActive(true);
                m_LVtextP1.text = (mountModel._DicHorse[ID].Lv+1) + Language.Get("Z1041");
                HorseUpConfig horseUpconfigNext = HorseUpConfig.GetHorseIDAndLV(ID, mountModel._DicHorse[ID].Lv + 1);
                int[] strAttrValueNext = horseUpconfigNext.AttrValue;
                Dictionary<int, int> AddPowerDic1 = new Dictionary<int, int>();
                AddPowerDic1.Clear();
                if (strAttrValueNext.Length != 0)
                {
                    curMountLifeText1.text = strAttrValueNext[0].ToString();//生命
                    curMountAttackText1.text = strAttrValueNext[1].ToString();//攻击
                    curMountSpeedText1.text = strAttrValueNext[2].ToString();//速度
                    AddPowerDic1.Add(6, strAttrValueNext[0]);
                    AddPowerDic1.Add(7, strAttrValueNext[1]);
                }
                int _scoreNum1 = 0;
                int _scoreNumAll1 = 0;
                for (int i = 0; i < MountSkills.Count; i++)
                {
                    if (mountModel._DicHorse[ID].Lv+1 >= MountSkills[i].HorseLV)
                    {
                        SkillConfig skillconfig = SkillConfig.Get(MountSkills[i].SkillID);
                        if (skillconfig != null)
                        {
                            _scoreNum1 += skillconfig.FightPower;
                        }
                    }
                }
                _scoreNumAll1 = UIHelper.GetFightPower(AddPowerDic1) + _scoreNum1;
                curMountFightingText1.text = _scoreNumAll1.ToString();//战斗力
            }
        }
System/RoleParticulars/RoleParticularModel.cs
@@ -211,93 +211,14 @@
        public int GetHorseFightPower(int _id, int lv)
        {
            var fightPower = GetHorseSkillFightPower(_id, lv);
            var horseUpConfig = HorseUpConfig.GetHorseIDAndLV(_id, lv);
            if (horseUpConfig == null)
            {
                return 0;
            }
            Dictionary<int, int> dict = new Dictionary<int, int>();
            int[] propertys = horseUpConfig.AttrType;
            int[] values = horseUpConfig.AttrValue;
            for (int i = 0; i < propertys.Length; i++)
            {
                if (propertys[i] == (int)PropertyType.ATK || propertys[i] == (int)PropertyType.HP)
                {
                    if (!dict.ContainsKey(propertys[i]))
                    {
                        dict.Add(propertys[i], values[i]);
                    }
                    else
                    {
                        dict[propertys[i]] += values[i];
                    }
                }
            }
            fightPower += UIHelper.GetFightPower(dict);
            var config = HorseConfig.Get(_id);
            fightPower += config.InitFightPower;
            return fightPower;
        }
        public int GetHorseSkillFightPower(int _id, int lv)
        {
            var fightPower = 0;
            HorseUpConfig.GetHorseSkills(_id, lv, true, ref skills);
            for (int i = 0; i < skills.Count; i++)
            {
                Dictionary<int, int> dict1 = null;
                Dictionary<int, int> dict2 = null;
                var skillConfig = SkillConfig.Get(skills[i]);
                if (skillConfig == null)
                {
                    continue;
                }
                if (skillConfig.Effect1 == (int)RidingAndPetActivationModel.RidingAndPetProperty.MountProperty1
                    || skillConfig.Effect1 == (int)RidingAndPetActivationModel.RidingAndPetProperty.MountProperty2)
                {
                    bool single = skillConfig.Effect1 == (int)RidingAndPetActivationModel.RidingAndPetProperty.MountProperty1;
                    Dictionary<int, int> dict = single ? dict1 : dict2;
                    dict = GetHorseSkillProperty(skillConfig.EffectValue11, skillConfig.EffectValue12, skillConfig.EffectValue13, single);
                }
                if (skillConfig.Effect2 == (int)RidingAndPetActivationModel.RidingAndPetProperty.MountProperty1
                    || skillConfig.Effect2 == (int)RidingAndPetActivationModel.RidingAndPetProperty.MountProperty2)
                {
                    bool single = skillConfig.Effect2 == (int)RidingAndPetActivationModel.RidingAndPetProperty.MountProperty1;
                    Dictionary<int, int> dict = single ? dict1 : dict2;
                    dict = GetHorseSkillProperty(skillConfig.EffectValue21, skillConfig.EffectValue22, skillConfig.EffectValue23, single);
                }
                if (skillConfig.Effect3 == (int)RidingAndPetActivationModel.RidingAndPetProperty.MountProperty1
                    || skillConfig.Effect3 == (int)RidingAndPetActivationModel.RidingAndPetProperty.MountProperty2)
                {
                    bool single = skillConfig.Effect3 == (int)RidingAndPetActivationModel.RidingAndPetProperty.MountProperty1;
                    Dictionary<int, int> dict = single ? dict1 : dict2;
                    dict = GetHorseSkillProperty(skillConfig.EffectValue31, skillConfig.EffectValue32, skillConfig.EffectValue33, single);
                }
                if (skillConfig.Effect4 == (int)RidingAndPetActivationModel.RidingAndPetProperty.MountProperty1
                    || skillConfig.Effect4 == (int)RidingAndPetActivationModel.RidingAndPetProperty.MountProperty2)
                {
                    bool single = skillConfig.Effect4 == (int)RidingAndPetActivationModel.RidingAndPetProperty.MountProperty1;
                    Dictionary<int, int> dict = single ? dict1 : dict2;
                    dict = GetHorseSkillProperty(skillConfig.EffectValue41, skillConfig.EffectValue42, skillConfig.EffectValue43, single);
                }
                if (skillConfig.Effect5 == (int)RidingAndPetActivationModel.RidingAndPetProperty.MountProperty1
                    || skillConfig.Effect5 == (int)RidingAndPetActivationModel.RidingAndPetProperty.MountProperty2)
                {
                    bool single = skillConfig.Effect5 == (int)RidingAndPetActivationModel.RidingAndPetProperty.MountProperty1;
                    Dictionary<int, int> dict = single ? dict1 : dict2;
                    dict = GetHorseSkillProperty(skillConfig.EffectValue51, skillConfig.EffectValue52, skillConfig.EffectValue53, single);
                }
                if (skillConfig.Effect6 == (int)RidingAndPetActivationModel.RidingAndPetProperty.MountProperty1
                    || skillConfig.Effect6 == (int)RidingAndPetActivationModel.RidingAndPetProperty.MountProperty2)
                {
                    bool single = skillConfig.Effect6 == (int)RidingAndPetActivationModel.RidingAndPetProperty.MountProperty1;
                    Dictionary<int, int> dict = single ? dict1 : dict2;
                    dict = GetHorseSkillProperty(skillConfig.EffectValue61, skillConfig.EffectValue62, skillConfig.EffectValue63, single);
                }
                fightPower += dict1 == null ? 0 : UIHelper.GetFightPower(dict1);
                fightPower += dict2 == null ? 0 : UIHelper.GetFightPower(dict2);
                fightPower += skillConfig.FightPower;
            }
            return fightPower;
        }
@@ -308,139 +229,12 @@
                return;
            }
            propertyDict.Clear();
            for (int i = 0; i < horses.Count; i++)
            {
                HorseUpConfig horseUpConfig = HorseUpConfig.GetHorseIDAndLV(horses[i].id, horses[i].lv);
                if (horseUpConfig == null)
                {
                    continue;
                }
                GetHorseProperty(horses[i].id, horses[i].lv, ref propertyDict);
                int[] propertys = horseUpConfig.AttrType;
                int[] values = horseUpConfig.AttrValue;
                for (int k = 0; k < propertys.Length; k++)
                {
                    if (!propertyDict.ContainsKey(propertys[k]))
                    {
                        propertyDict.Add(propertys[k], values[k]);
                    }
                    else
                    {
                        if (propertys[k] == (int)PropertyType.MoveSpeed)
                        {
                            if (values[k] > propertyDict[propertys[k]])
                            {
                                propertyDict[propertys[k]] = values[k];
                            }
                        }
                        else
                        {
                            propertyDict[propertys[k]] += values[k];
                        }
                    }
                }
            }
        }
        public void GetHorseProperty(int _id, int lv, ref Dictionary<int, int> propertyDict)
        {
            HorseUpConfig.GetHorseSkills(_id, lv, true, ref skills);
            for (int i = 0; i < skills.Count; i++)
            {
                Dictionary<int, int> dict1 = null;
                Dictionary<int, int> dict2 = null;
                var skillConfig = SkillConfig.Get(skills[i]);
                if (skillConfig == null)
                {
                    continue;
                }
                if (skillConfig.Effect1 == (int)RidingAndPetActivationModel.RidingAndPetProperty.MountProperty1
                    || skillConfig.Effect1 == (int)RidingAndPetActivationModel.RidingAndPetProperty.MountProperty2)
                {
                    bool single = skillConfig.Effect1 == (int)RidingAndPetActivationModel.RidingAndPetProperty.MountProperty1;
                    if (single)
                    {
                        dict1 = GetHorseSkillProperty(skillConfig.EffectValue11, skillConfig.EffectValue12, skillConfig.EffectValue13, single);
                    }
                    else
                    {
                        dict2 = GetHorseSkillProperty(skillConfig.EffectValue11, skillConfig.EffectValue12, skillConfig.EffectValue13, single);
                    }
                }
                if (skillConfig.Effect2 == (int)RidingAndPetActivationModel.RidingAndPetProperty.MountProperty1
                    || skillConfig.Effect2 == (int)RidingAndPetActivationModel.RidingAndPetProperty.MountProperty2)
                {
                    bool single = skillConfig.Effect2 == (int)RidingAndPetActivationModel.RidingAndPetProperty.MountProperty1;
                    if (single)
                    {
                        dict1 = GetHorseSkillProperty(skillConfig.EffectValue21, skillConfig.EffectValue22, skillConfig.EffectValue23, single);
                    }
                    else
                    {
                        dict2 = GetHorseSkillProperty(skillConfig.EffectValue21, skillConfig.EffectValue22, skillConfig.EffectValue23, single);
                    }
                }
                if (skillConfig.Effect3 == (int)RidingAndPetActivationModel.RidingAndPetProperty.MountProperty1
                    || skillConfig.Effect3 == (int)RidingAndPetActivationModel.RidingAndPetProperty.MountProperty2)
                {
                    bool single = skillConfig.Effect3 == (int)RidingAndPetActivationModel.RidingAndPetProperty.MountProperty1;
                    if (single)
                    {
                        dict1 = GetHorseSkillProperty(skillConfig.EffectValue31, skillConfig.EffectValue32, skillConfig.EffectValue33, single);
                    }
                    else
                    {
                        dict2 = GetHorseSkillProperty(skillConfig.EffectValue31, skillConfig.EffectValue32, skillConfig.EffectValue33, single);
                    }
                }
                if (skillConfig.Effect4 == (int)RidingAndPetActivationModel.RidingAndPetProperty.MountProperty1
                    || skillConfig.Effect4 == (int)RidingAndPetActivationModel.RidingAndPetProperty.MountProperty2)
                {
                    bool single = skillConfig.Effect4 == (int)RidingAndPetActivationModel.RidingAndPetProperty.MountProperty1;
                    if (single)
                    {
                        dict1 = GetHorseSkillProperty(skillConfig.EffectValue41, skillConfig.EffectValue42, skillConfig.EffectValue43, single);
                    }
                    else
                    {
                        dict2 = GetHorseSkillProperty(skillConfig.EffectValue41, skillConfig.EffectValue42, skillConfig.EffectValue43, single);
                    }
                }
                if (skillConfig.Effect5 == (int)RidingAndPetActivationModel.RidingAndPetProperty.MountProperty1
                    || skillConfig.Effect5 == (int)RidingAndPetActivationModel.RidingAndPetProperty.MountProperty2)
                {
                    bool single = skillConfig.Effect5 == (int)RidingAndPetActivationModel.RidingAndPetProperty.MountProperty1;
                    if (single)
                    {
                        dict1 = GetHorseSkillProperty(skillConfig.EffectValue51, skillConfig.EffectValue52, skillConfig.EffectValue53, single);
                    }
                    else
                    {
                        dict2 = GetHorseSkillProperty(skillConfig.EffectValue51, skillConfig.EffectValue52, skillConfig.EffectValue53, single);
                    }
                }
                if (skillConfig.Effect6 == (int)RidingAndPetActivationModel.RidingAndPetProperty.MountProperty1
                    || skillConfig.Effect6 == (int)RidingAndPetActivationModel.RidingAndPetProperty.MountProperty2)
                {
                    bool single = skillConfig.Effect6 == (int)RidingAndPetActivationModel.RidingAndPetProperty.MountProperty1;
                    if (single)
                    {
                        dict1 = GetHorseSkillProperty(skillConfig.EffectValue61, skillConfig.EffectValue62, skillConfig.EffectValue63, single);
                    }
                    else
                    {
                        dict2 = GetHorseSkillProperty(skillConfig.EffectValue61, skillConfig.EffectValue62, skillConfig.EffectValue63, single);
                    }
                }
                if (dict1 != null)
                {
                    PastePropertyDict(dict1, propertyDict);
                }
                if (dict2 != null)
                {
                    PastePropertyDict(dict2, propertyDict);
                }
            }
        }
        private void PastePropertyDict(Dictionary<int, int> source, Dictionary<int, int> target)
@@ -480,57 +274,7 @@
        private Dictionary<int, int> GetHorseSkillProperty(int condition, int property, int percent, bool single)
        {
            Dictionary<int, int> dict = new Dictionary<int, int>();
            dict.Add(6, 0);
            dict.Add(7, 0);
            var viewplayer = GetViewPlayerData(viewPlayer);
            var horses = viewplayer.rolePlusData.horses;
            if (single)
            {
                var horseInfo = horses.Find((x) =>
                 {
                     return x.id == condition;
                 });
                HorseUpConfig horseUpConfig = HorseUpConfig.GetHorseIDAndLV(horseInfo.id, horseInfo.lv);
                if (horseUpConfig == null)
                {
                    return dict;
                }
                int[] propertys = horseUpConfig.AttrType;
                int[] values = horseUpConfig.AttrValue;
                for (int k = 0; k < propertys.Length; k++)
                {
                    if (propertys[k] == property && dict.ContainsKey(property))
                    {
                        dict[property] += (int)(values[k] * ((float)percent / 10000));
                    }
                }
            }
            else
            {
                for (int i = 0; i < horses.Count; i++)
                {
                    HorseConfig horseConfig = HorseConfig.Get(horses[i].id);
                    if (horseConfig == null)
                    {
                        continue;
                    }
                    if (horseConfig.Quality == condition)
                    {
                        HorseUpConfig horseUpConfig = HorseUpConfig.GetHorseIDAndLV(horses[i].id, horses[i].lv);
                        int[] propertys = horseUpConfig.AttrType;
                        int[] values = horseUpConfig.AttrValue;
                        for (int k = 0; k < propertys.Length; k++)
                        {
                            if (propertys[k] == property && dict.ContainsKey(property))
                            {
                                dict[property] += (int)(values[k] * ((float)percent / 10000));
                            }
                        }
                    }
                }
            }
            return dict;
        }
System/RoleParticulars/RoleParticularsWin.cs
@@ -155,7 +155,7 @@
            if (viewPlayerData != null)
            {
                m_ViewHorse.SetActive(viewPlayerData.rolePlusData.horses.Count > 0);
                m_ViewHorse.SetActive(false);
                m_ViewPet.SetActive(viewPlayerData.rolePlusData.pets.Count > 0);
                if (viewPlayerData.rolePropData.FamilyID == 0)
System/RoleParticulars/ViewHorseDetailWin.cs
@@ -148,20 +148,6 @@
        void DisplaySkills(int id, int lv)
        {
            HorseUpConfig.GetHorseSkills(id, lv, false, ref skills);
            for (int i = 0; i < m_HorseSkills.Length; i++)
            {
                if (i < skills.Count)
                {
                    m_HorseSkills[i].SetActive(true);
                    var condition = HorseUpConfig.GetSkillCondition(id, skills[i]);
                    m_HorseSkills[i].Display(id, skills[i], lv >= condition ? 0 : condition);
                }
                else
                {
                    m_HorseSkills[i].SetActive(false);
                }
            }
        }
        void DisplayTotalSkills(List<RoleParticularModel.HorseInfo> horses)
@@ -169,36 +155,7 @@
            displayTotalSkills.Clear();
            unlockTotalSkills.Clear();
            for (int i = 0; i < horses.Count; i++)
            {
                HorseUpConfig.GetHorseSkills(horses[i].id, horses[i].lv, true, ref skills);
                unlockTotalSkills.AddRange(skills);
                foreach (var id in skills)
                {
                    var config = SkillConfig.Get(id);
                    var effect = SkillConfig.GetSkillEffectValue(config);
                    var skillId = 0;
                    if (mountModel.TryGetIntegrationSkill(effect, out skillId))
                    {
                        if (!displayTotalSkills.Contains(skillId))
                        {
                            displayTotalSkills.Add(skillId);
                        }
                        continue;
                    }
                    displayTotalSkills.Add(id);
                }
            }
            displayTotalSkills.Sort(Compare);
            m_SkillController.Refresh();
            var line = Mathf.CeilToInt((float)displayTotalSkills.Count / m_LineCount);
            for (int i = 0; i < line; i++)
            {
                m_SkillController.AddCell(ScrollerDataType.Header, i);
            }
            m_SkillController.Restart();
        }
        void DisplayModel(int id)
@@ -305,11 +262,6 @@
            private void OnClickSkill()
            {
                var config = HorseConfig.Get(horseId);
                var skillConfig = SkillConfig.Get(skillId);
                var label1 = skillConfig.Description;
                var label2 = Language.Get("pet_SkillTipLv", config.Name, HorseUpConfig.GetSkillCondition(horseId, skillId));
                SkillDetails.ShowSkillDetails(skillId, SkillDetails.SkillSourceType.ViewHorsePet, skillConfig.FightPower, label1, label2);
            }
            public void SetActive(bool active)
Utility/ConfigInitiator.cs
@@ -276,7 +276,6 @@
        normalTasks.Add(new ConfigInitTask("HolidayHomingConfig", () => { HolidayHomingConfig.Init(); }, () => { return HolidayHomingConfig.inited; }));
        normalTasks.Add(new ConfigInitTask("HolidayHomingPointConfig", () => { HolidayHomingPointConfig.Init(); }, () => { return HolidayHomingPointConfig.inited; }));
        normalTasks.Add(new ConfigInitTask("HorseConfig", () => { HorseConfig.Init(); }, () => { return HorseConfig.inited; }));
        normalTasks.Add(new ConfigInitTask("HorseUpConfig", () => { HorseUpConfig.Init(); }, () => { return HorseUpConfig.inited; }));
        normalTasks.Add(new ConfigInitTask("IceLodeStarAwardConfig", () => { IceLodeStarAwardConfig.Init(); }, () => { return IceLodeStarAwardConfig.inited; }));
        normalTasks.Add(new ConfigInitTask("XMZZAchievementConfig", () => { XMZZAchievementConfig.Init(); }, () => { return XMZZAchievementConfig.inited; }));
        normalTasks.Add(new ConfigInitTask("CrossRealmPKOrderAwardConfig", () => { CrossRealmPKOrderAwardConfig.Init(); }, () => { return CrossRealmPKOrderAwardConfig.inited; }));
@@ -327,6 +326,7 @@
        normalTasks.Add(new ConfigInitTask("CustomAward", () => { CustomAwardConfig.Init(); }, () => { return CustomAwardConfig.inited; }));
        normalTasks.Add(new ConfigInitTask("FamilyBossHurtAward", () => { FamilyBossHurtAwardConfig.Init(); }, () => { return FamilyBossHurtAwardConfig.inited; }));
        normalTasks.Add(new ConfigInitTask("RealmXXZL", () => { RealmXXZLConfig.Init(); }, () => { return RealmXXZLConfig.inited; }));
        normalTasks.Add(new ConfigInitTask("HorseStarUp", () => { HorseStarUpConfig.Init(); }, () => { return HorseStarUpConfig.inited; }));
    }