Merge branch 'master' of http://192.168.0.87:10010/r/snxxz_scripts
| | |
| | | }
|
| | | 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);
|
| | | }
|
| | |
| | | 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) |
| | |
| | | public struct LegendProperty |
| | | { |
| | | public bool isPreview; |
| | | public int trueCount; |
| | | public List<Int2> properties; |
| | | } |
| | | |
| | |
| | | { |
| | | var data = new LegendProperty(); |
| | | data.isPreview = true; |
| | | data.trueCount = LegendPropertyUtility.GetEquipPropertyCount(itemId); |
| | | data.properties = LegendPropertyUtility.GetEquipProperties(itemId); |
| | | |
| | | return data; |
| | |
| | | //-------------------------------------------------------- |
| | | using UnityEngine; |
| | | using System.Collections; |
| | | using System.Collections.Generic; |
| | | using UnityEngine.UI; |
| | | |
| | | namespace Snxxz.UI |
| | |
| | | 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]; |
| | |
| | | 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()); |
| | | } |
| | | |
| | | } |