hch
1 天以前 6521aa56fbeba8d6509d5736bd35b1d42dcc4029
328 【主界面】坐骑系统
7个文件已修改
147 ■■■■ 已修改文件
Main/Config/PartialConfigs/PlayerPropertyConfig.cs 20 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/Core/GameEngine/Player/PlayerBaseData.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/System/Horse/HorseManager.cs 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/System/Horse/HorseRankUPWin.cs 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/System/Horse/HorseSuccessWin.cs 75 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/System/Horse/HorseWin.cs 19 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/System/Main/HomeWin.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/Config/PartialConfigs/PlayerPropertyConfig.cs
@@ -106,12 +106,13 @@
        }
    }
    public static string GetValueDescription(int id, long value)
    //largeNumFormat 大数值格式:0 默认原数值 1 按万或者(K)显示 2 按6位数以上(才转换大数值,根据情况可统一调整)
    public static string GetValueDescription(int id, long value, int largeNumFormat = 1)
    {
        return GetValueDescription(id, value, true);
        return GetValueDescriptionEx(id, value, largeNumFormat);
    }
    public static string GetValueDescription(int id, long value, bool largeValue)
    public static string GetValueDescriptionEx(int id, long value, int largeNumFormat = 1)
    {
        var config = Get(id);
        if (config == null)
@@ -134,10 +135,21 @@
        }
        var label = string.Empty;
        if (largeValue)
        if (largeNumFormat == 1)
        {
            label = UIHelper.ReplaceLargeNum(result);
        }
        else if (largeNumFormat == 2)
        {
            if (result > 999999)
            {
                label = UIHelper.ReplaceLargeNum(result, 6);
            }
            else
            {
                label = result.ToString();
            }
        }
        else
        {
            label = result.ToString();
Main/Core/GameEngine/Player/PlayerBaseData.cs
@@ -101,7 +101,7 @@
    public int BasicsDefense;//基础防御
    public int BasicsScoreAHit;//基础命中
    public int BasicsDodge;//基础闪避
    public uint equipShowSwitch;//当前配置的坐骑外观ID存储在  个位数十位数(最大支持 1~99)
    public uint equipShowSwitch;//当前配置的坐骑外观ID存储在(最大支持 1~999)
    public int mater;//灵根属性——金
    public int wood;//灵根属性——木
    public int water;//灵根属性——水
Main/System/Horse/HorseManager.cs
@@ -66,17 +66,26 @@
    public int GetHorseSkinID()
    {
        return (int)PlayerDatas.Instance.baseData.equipShowSwitch%100;
        return (int)PlayerDatas.Instance.baseData.equipShowSwitch%1000;
    }
    public void UpdateHorseInfo(HA303_tagSCHorseClassInfo netPack)
    {
        bool isOpenSuccess = false;
        if (classLV != netPack.ClassLV && DTC0403_tagPlayerLoginLoadOK.finishedLogin)
        {
            isOpenSuccess = true;
        }
        classLV = netPack.ClassLV;
        horseLV = netPack.HorseLV;
        exp = netPack.Exp;
        UpdateRedpoint();
        RefreshAttr();
        OnHorseUpdateEvent?.Invoke();
        if (isOpenSuccess)
        {
            UIManager.Instance.OpenWindow<HorseSuccessWin>();
        }
    }
Main/System/Horse/HorseRankUPWin.cs
@@ -48,9 +48,12 @@
        {
            if (i < keys.Count)
            {
                var curValue = HorseManager.Instance.attrDic[keys[i]];
                attrNameTexts[i].text = PlayerPropertyConfig.Get(keys[i]).Name;
                attrValueTexts[i].text = PlayerPropertyConfig.GetValueDescription(keys[i], HorseManager.Instance.attrDic[keys[i]]);
                nextAttrValueTexts[i].text = PlayerPropertyConfig.GetValueDescription(keys[i], nextConfig.ClassAttrValueList[i]);
                attrValueTexts[i].text = PlayerPropertyConfig.GetValueDescription(keys[i], curValue, 2);
                nextAttrValueTexts[i].text = PlayerPropertyConfig.GetValueDescription(keys[i],
                    curValue + nextConfig.ClassAttrValueList[i] + nextConfig.PerLVAttrValueList[i], 2);
            }
        }
@@ -61,16 +64,17 @@
            if (i < nextConfig.ClassSpecAttrIDList.Length)
            {
                specialAttrRect[i].SetActive(true);
                specialAttrNameTexts[i].text = PlayerPropertyConfig.Get(nextKeys[i]).Name;
                var id = nextConfig.ClassSpecAttrIDList[i];
                specialAttrNameTexts[i].text = PlayerPropertyConfig.Get(id).Name;
                if (i < nextKeys.Count)
                {
                    specialAttrValueTexts[i].text = PlayerPropertyConfig.GetValueDescription(nextConfig.ClassSpecAttrIDList[i], HorseManager.Instance.specialAttrDic[nextKeys[i]]);
                    specialNextAttrValueTexts[i].text = PlayerPropertyConfig.GetValueDescription(nextConfig.ClassSpecAttrIDList[i], HorseManager.Instance.specialAttrDic[nextKeys[i]] + nextConfig.ClassSpecAttrValueList[i]);
                    specialAttrValueTexts[i].text = PlayerPropertyConfig.GetValueDescription(id, HorseManager.Instance.specialAttrDic[nextKeys[i]], 2);
                    specialNextAttrValueTexts[i].text = PlayerPropertyConfig.GetValueDescription(id, HorseManager.Instance.specialAttrDic[nextKeys[i]] + nextConfig.ClassSpecAttrValueList[i], 2);
                }
                else
                {
                    specialAttrValueTexts[i].text = PlayerPropertyConfig.GetValueDescription(nextKeys[i], 0);
                    specialNextAttrValueTexts[i].text = PlayerPropertyConfig.GetValueDescription(nextKeys[i], nextConfig.ClassSpecAttrValueList[i]);
                    specialAttrValueTexts[i].text = PlayerPropertyConfig.GetValueDescription(id, 0);
                    specialNextAttrValueTexts[i].text = PlayerPropertyConfig.GetValueDescription(id, nextConfig.ClassSpecAttrValueList[i], 2);
                }
            }
            else
Main/System/Horse/HorseSuccessWin.cs
@@ -1,27 +1,94 @@
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using UnityEngine;
using UnityEngine.UI;
/// <summary>
/// 坐骑
/// 坐骑进阶成功
/// </summary>
public class HorseSuccessWin : UIBase
{
    [SerializeField] Button bagBtn;
    [SerializeField] Text curLVText;
    [SerializeField] Text nextLVText;
    [SerializeField] Text[] attrNameTexts;
    [SerializeField] Text[] attrValueTexts;
    [SerializeField] Text[] nextAttrValueTexts;
    [SerializeField] Transform[] specialAttrRect;
    [SerializeField] Text[] specialAttrNameTexts;
    [SerializeField] Text[] specialAttrValueTexts;
    [SerializeField] Text[] specialNextAttrValueTexts;
    [SerializeField] Button okBtn;
    protected override void InitComponent()
    {
        okBtn.AddListener(CloseWindow);
    }
    protected override void OnPreOpen()
    {
        Display();
    }
    protected override void OnPreClose()
    {
    }
    void Display()
    {
        var config = HorseClassConfig.Get(HorseManager.Instance.classLV - 1);
        curLVText.text = Language.Get("Horse8", HorseManager.Instance.classLV - 1, config.MaxLV);
        nextLVText.text = Language.Get("Horse8", HorseManager.Instance.classLV, 1);
        var nextConfig = HorseClassConfig.Get(HorseManager.Instance.classLV);
        var keys = HorseManager.Instance.attrDic.Keys.ToList();
        keys.Sort();
        for (int i = 0; i < attrNameTexts.Length; i++)
        {
            if (i < keys.Count)
            {
                var curValue = HorseManager.Instance.attrDic[keys[i]];
                attrNameTexts[i].text = PlayerPropertyConfig.Get(keys[i]).Name;
                attrValueTexts[i].text = PlayerPropertyConfig.GetValueDescription(keys[i],
                    curValue - nextConfig.ClassAttrValueList[i] - nextConfig.PerLVAttrValueList[i], 2);
                nextAttrValueTexts[i].text = PlayerPropertyConfig.GetValueDescription(keys[i], curValue, 2);
            }
        }
        var nextKeys = HorseManager.Instance.specialAttrDic.Keys.ToList();
        nextKeys.Sort();
        for (int i = 0; i < specialAttrRect.Length; i++)
        {
            if (i < nextConfig.ClassSpecAttrIDList.Length)
            {
                specialAttrRect[i].SetActive(true);
                var id = nextConfig.ClassSpecAttrIDList[i];
                specialAttrNameTexts[i].text = PlayerPropertyConfig.Get(id).Name;
                if (i < nextKeys.Count)
                {
                    specialAttrValueTexts[i].text = PlayerPropertyConfig.GetValueDescription(id,
                        HorseManager.Instance.specialAttrDic[nextKeys[i]] - nextConfig.ClassSpecAttrValueList[i], 2);
                    specialNextAttrValueTexts[i].text = PlayerPropertyConfig.GetValueDescription(id,
                        HorseManager.Instance.specialAttrDic[nextKeys[i]], 2);
                }
                else
                {
                    specialAttrValueTexts[i].text = PlayerPropertyConfig.GetValueDescription(id, 0);
                    specialNextAttrValueTexts[i].text = PlayerPropertyConfig.GetValueDescription(id, nextConfig.ClassSpecAttrValueList[i], 2);
                }
            }
            else
            {
                specialAttrRect[i].SetActive(false);
            }
        }
    }
Main/System/Horse/HorseWin.cs
@@ -157,20 +157,33 @@
        keys.Sort();
        //满级 和下级属性
        var nextConfig = HorseClassConfig.Get(HorseManager.Instance.classLV + 1);
        var nextAttr = state == 1 ? nextConfig.ClassAttrValueList : (state == 0 ? config.PerLVAttrValueList : new int[config.AttrIDList.Length]);
        for (int i = 0; i < attrNameTexts.Length; i++)
        {
            if (i < keys.Count)
            {
                attrNameTexts[i].text = PlayerPropertyConfig.Get(keys[i]).Name;
                attrValueTexts[i].text = PlayerPropertyConfig.GetValueDescription(keys[i], HorseManager.Instance.attrDic[keys[i]]);
                nextAttrValueTexts[i].text = PlayerPropertyConfig.GetValueDescription(keys[i], nextAttr[i]);
                var curValue = HorseManager.Instance.attrDic[keys[i]];
                attrValueTexts[i].text = PlayerPropertyConfig.GetValueDescription(keys[i], curValue, 2);
                var addValue = 0;
                if (state == 0)
                {
                    addValue = config.PerLVAttrValueList[i];
                }
                else if (state == 1)
                {
                    addValue = nextConfig.ClassAttrValueList[i] + nextConfig.PerLVAttrValueList[i];
                }
                nextAttrValueTexts[i].text = PlayerPropertyConfig.GetValueDescription(keys[i], curValue + addValue, 2);
            }
        }
    }
    string GetSpecialAttr()
    {
        if (HorseManager.Instance.specialAttrDic.Count == 0)
            return "";
        List<string> attrList = new List<string>();
        foreach(var attrID in HorseManager.Instance.specialAttrDic.Keys)
        {
Main/System/Main/HomeWin.cs
@@ -503,7 +503,7 @@
        if (FuncOpen.Instance.IsFuncOpen((int)FuncOpenEnum.Horse))
        {
            horseBGImg.SetActive(true);
            //equipShowSwitch;//当前配置的坐骑外观ID存储在  个位数十位数(最大支持 1~99)
            //equipShowSwitch;//当前配置的坐骑外观ID存储在(最大支持 1~999)
            var skinConfig = HorseSkinConfig.Get(HorseManager.Instance.GetHorseSkinID());
            horseImg.SetOrgSprite(skinConfig.Icon, "Horse");
            horseLVText.text = Language.Get("Horse8",HorseManager.Instance.classLV, HorseManager.Instance.horseLV);