继续骑行海图初始位置,地图属性调整
This commit is contained in:
1 parent
724e43f392
commit
3757ae6e6c
10 files changed
+3279
-3274
No files matched your search
@@ -1,5 +1,7 @@
|
||||
using Assets.Scenes.Ride.Scripts.Model.CyclingModels;
|
||||
using Assets.Scripts.Apis.Models;
|
||||
using ChartAndGraph;
|
||||
using DG.Tweening;
|
||||
using GeoJSON.Net.Geometry;
|
||||
using Mapbox.Unity.Map;
|
||||
using Mapbox.Utils;
|
||||
@@ -11,6 +13,7 @@ using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using TurfCS;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
|
||||
namespace Assets.Scenes.Ride.Scripts
|
||||
{
|
||||
@@ -76,7 +79,14 @@ namespace Assets.Scenes.Ride.Scripts
|
||||
public Vector2d Currentlatlong { get => currentlatlong; }
|
||||
#endregion
|
||||
|
||||
#region UI对象
|
||||
|
||||
//UI对象
|
||||
protected GameObject headPanel;
|
||||
protected GraphChartBase graph;
|
||||
protected ChartDataSourceScript chartDataSourceScript;
|
||||
|
||||
#endregion
|
||||
void Start()
|
||||
{
|
||||
Init();
|
||||
@@ -102,6 +112,11 @@ namespace Assets.Scenes.Ride.Scripts
|
||||
mainController = transform.parent.GetComponent<CyclingController>();
|
||||
map = transform.parent.Find("Map").GetComponent<AbstractMap>();
|
||||
mapData = mainController.GetMapData();//获取路书信息
|
||||
|
||||
//获取海拔图UI对象
|
||||
var graphObject = transform.parent.Find("SingleUI/Panel/GraphChart");
|
||||
chartDataSourceScript = graphObject.GetComponent<ChartDataSourceScript>();
|
||||
graph = graphObject.GetComponent<GraphChartBase>();
|
||||
}
|
||||
|
||||
protected virtual void Excute()
|
||||
@@ -119,9 +134,12 @@ namespace Assets.Scenes.Ride.Scripts
|
||||
//骑行中
|
||||
protected virtual void Run()
|
||||
{
|
||||
if (mapData == null)
|
||||
return;
|
||||
ComputeNextSlope();//计算下一个坡度相关数据
|
||||
MoveGraphHead();//移动海拔图头像
|
||||
//人物动画控制
|
||||
if (characterAnimator != null && mapData != null)
|
||||
if (characterAnimator != null)
|
||||
{
|
||||
characterAnimator.SetFloat("Speed", (float)speed);
|
||||
characterAnimator.SetFloat("Slope", (float)currentSlope);
|
||||
@@ -286,5 +304,14 @@ namespace Assets.Scenes.Ride.Scripts
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region UI行为
|
||||
|
||||
protected virtual void MoveGraphHead()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user