海拔图区间微调,消息面板&线路等微调

This commit is contained in:
lishuo committed 2021-05-13 17:48:28 +08:00
1 parent b694a69f16
commit 46cc231fe7
19 files changed
+3604 -3034

No files matched your search

+7 -19
View File
@@ -133,19 +133,7 @@ namespace Assets.Scenes.Ride.Scripts
//开始骑行
if (GetStart())
{
//计算累计爬升
if (index > 0)
{
totalClimb = 0;
for (int i = 1; i <= index; i++)
{
var diff = mapData.List[i].Elevation - mapData.List[i - 1].Elevation;
if (diff > 0)
{
totalClimb += diff;
}
}
}
ticks++;
Compute();//接受蓝牙设备数据计算
@@ -164,7 +152,7 @@ namespace Assets.Scenes.Ride.Scripts
prePos = transform.localPosition;//当前点
thisRotation = transform.localRotation;
//移动动画控制
//if (distance > 0)
if (distance > 0)
{
StartCoroutine(MoveTo());//移动
}
@@ -234,7 +222,7 @@ namespace Assets.Scenes.Ride.Scripts
nextSlope = pointList[nextIndex].Grade;
nextSlopeDistance = sumDistance - totalDistance * 1000;
NextSlopeTotalDistance = pointList[nextIndex].Distance;
currentSlopeDistance = CurrentDistance-( totalDistance * 1000 - (sumDistance - pointList[index].Distance));
currentSlopeDistance = (totalDistance * 1000 - (sumDistance - pointList[index].Distance));// CurrentDistance-( totalDistance * 1000 - (sumDistance - pointList[index].Distance));
}
public double PreElevation;
public double PreSlope;
@@ -280,11 +268,11 @@ namespace Assets.Scenes.Ride.Scripts
t += Time.deltaTime;
Vector3 v = Vector3.Lerp(prePos, nextPos, t);
Vector3 nextPosition = new Vector3((float)Math.Round(v.x, 2), (float)Math.Round(v.y, 2), (float)Math.Round(v.z, 2));
if (!nextPosition.Equals(transform.localPosition))
//Vector3 nextPosition = new Vector3((float)Math.Round(v.x, 2), (float)Math.Round(v.y, 2), (float)Math.Round(v.z, 2));
//if (!nextPosition.Equals(transform.localPosition))
{
currentPos = nextPosition;
transform.localPosition = nextPosition;
currentPos = v;
transform.localPosition = v;
//Camera.main.transform.localPosition = nextPosition;
}
yield return new WaitForEndOfFrame();