少年修仙传客户端代码仓库
client_linchunjie
2019-03-16 6d6d8c06c27a083f2f74303c0f089304eba87e98
Merge branch 'master' of http://192.168.0.87:10010/r/snxxz_scripts
4个文件已修改
117 ■■■■ 已修改文件
Fight/MapTransferUtility.cs 48 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Fight/Stage/MapEditor/Game/ClientSceneManager.cs 53 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/ItemTip/EquipTipUtility.cs 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/ItemTip/TipLegendPropertyWidget.cs 14 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Fight/MapTransferUtility.cs
@@ -264,27 +264,35 @@
        }
        else
        {
            // 不可达的情况, 这里寻找是否有可以跳跃的点
            Vector3 _jumpPos = ClientSceneManager.Instance.GetCloseTransPoint(_destPostion);
            if (_jumpPos == Vector3.zero)
            while (true)
            {
                Debug.LogErrorFormat("移动至NPC: {0} 时找不到任何跳跃点", npcID);
                yield break;
            }
            float _dis = MathUtility.DistanceSqrtXZ(_hero.Pos, _jumpPos);
            while (_dis > 0.01f)
            {
                _dis = MathUtility.DistanceSqrtXZ(_hero.Pos, _jumpPos);
                _hero.MoveToPosition(_jumpPos);
                yield return null;
            }
            while (!GA_Hero.s_Flying)
            {
                yield return null;
            }
            while (GA_Hero.s_Flying)
            {
                yield return null;
                if (PathFinder.WalkAble(_hero.Pos, _destPostion, _dist))
                {
                    break;
                }
                var _nextPos = ClientSceneManager.Instance.GetTransPoint(_hero.Pos, _destPostion);
                // 如果找到的下一个点
                if (!PathFinder.WalkAble(_hero.Pos, _nextPos)
                 || _nextPos == Vector3.zero)
                {
                    Debug.LogErrorFormat("移动至NPC: {0} 时找不到任何跳跃点", npcID);
                    break;
                }
                float _dis = MathUtility.DistanceSqrtXZ(_hero.Pos, _nextPos);
                while (_dis > 0.01f)
                {
                    _dis = MathUtility.DistanceSqrtXZ(_hero.Pos, _nextPos);
                    _hero.MoveToPosition(_nextPos);
                    yield return null;
                }
                while (!GA_Hero.s_Flying)
                {
                    yield return null;
                }
                while (GA_Hero.s_Flying)
                {
                    yield return null;
                }
            }
            _MoveToNPC(npcID, sid);
        }
Fight/Stage/MapEditor/Game/ClientSceneManager.cs
@@ -250,13 +250,58 @@
        return null;
    }
    private List<MapTrasfer> m_ChkedList = new List<MapTrasfer>();
    public Vector3 GetTransPoint(Vector3 start, Vector3 next)
    {
        m_ChkedList.Clear();
        return GetNext(start, next);
    }
    private Vector3 GetNext(Vector3 start, Vector3 next)
    {
        Vector3 _targetPos = Vector3.zero;
        // 遍历寻找到可移动至目标点的跳跃点
        foreach (var _t in m_MapData.transfers)
        {
            if (m_ChkedList.Contains(_t))
            {
                continue;
            }
            for (int i = 0; i < _t.transferPoints.Length; ++i)
            {
                if (PathFinder.WalkAble(next, _t.transferPoints[i].position))
                {
                    if (i == 0)
                    {
                        _targetPos = _t.transferPoints[_t.transferPoints.Length - 1].position;
                    }
                    else
                    {
                        _targetPos = _t.transferPoints[0].position;
                    }
                    m_ChkedList.Add(_t);
                    break;
                }
            }
            if (_targetPos != Vector3.zero)
            {
                break;
            }
        }
        if (!PathFinder.WalkAble(start, _targetPos))
        {
            return GetNext(start, _targetPos);
        }
        return _targetPos;
    }
    public Vector3 GetCloseTransPoint(Vector3 pos)
    {
        // 遍历找到离给定点最近并且可寻路至的传送点 P
        // 找到 P点的 另一端 P1
        // 判断当前传入的点是否可以寻路至 P1
        // 不行的话重新寻找 可以的话返回 P1 的坐标
        Vector3 _targetPos = Vector3.zero;
        foreach (var _t in m_MapData.transfers)
System/ItemTip/EquipTipUtility.cs
@@ -56,6 +56,7 @@
        public struct LegendProperty
        {
            public bool isPreview;
            public int trueCount;
            public List<Int2> properties;
        }
@@ -334,6 +335,7 @@
        {
            var data = new LegendProperty();
            data.isPreview = true;
            data.trueCount = LegendPropertyUtility.GetEquipPropertyCount(itemId);
            data.properties = LegendPropertyUtility.GetEquipProperties(itemId);
            return data;
System/ItemTip/TipLegendPropertyWidget.cs
@@ -4,6 +4,7 @@
//--------------------------------------------------------
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
using UnityEngine.UI;
namespace Snxxz.UI
@@ -16,7 +17,7 @@
        public void Display(EquipTipUtility.LegendProperty data)
        {
            var count = data.properties.Count;
            var lines = new string[count];
            var lines = new List<string>();
            for (int i = 0; i < count; i++)
            {
                var property = data.properties[i];
@@ -25,15 +26,20 @@
                var quality = LegendPropertyConfig.Get(property.x).quality;
                if (data.isPreview)
                {
                    lines[i] = UIHelper.AppendColor(quality, string.Format("【推荐】{0}+{1}", config.Name, value));
                    lines.Add(UIHelper.AppendColor(quality, string.Format("【推荐】{0}+{1}", config.Name, value)));
                }
                else
                {
                    lines[i] = UIHelper.AppendColor(quality, string.Format("{0}+{1}", config.Name, value));
                    lines.Add(UIHelper.AppendColor(quality, string.Format("{0}+{1}", config.Name, value)));
                }
            }
            m_PropertyBehaviours.text = string.Join("\r\n", lines);
            if (data.isPreview)
            {
                var description = UIHelper.AppendColor(TextColType.Green, UIHelper.ReplaceNewLine(Language.Get("LegendAttributePriview1", data.trueCount)));
                lines.Insert(0, description);
            }
            m_PropertyBehaviours.text = string.Join("\r\n", lines.ToArray());
        }
    }