继续骑行海图初始位置,地图属性调整
This commit is contained in:
1 parent
724e43f392
commit
3757ae6e6c
10 files changed
+3279
-3274
No files matched your search
@@ -5,6 +5,8 @@ using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Assets.Scenes.Ride.Scripts.Model.RiderModels;
|
||||
using System;
|
||||
using ChartAndGraph;
|
||||
using DG.Tweening;
|
||||
|
||||
namespace Assets.Scenes.Ride.Scripts
|
||||
{
|
||||
@@ -34,6 +36,8 @@ namespace Assets.Scenes.Ride.Scripts
|
||||
trail.motionVectorGenerationMode = MotionVectorGenerationMode.ForceNoMotion;
|
||||
trail.receiveShadows = false;
|
||||
trail.rayTracingMode = UnityEngine.Experimental.Rendering.RayTracingMode.Off;
|
||||
|
||||
headPanel = transform.parent.Find("SingleUI/Panel/GraphChart/HeadPanel").gameObject;
|
||||
}
|
||||
TargetData targetData;
|
||||
/// <summary>
|
||||
@@ -50,10 +54,10 @@ namespace Assets.Scenes.Ride.Scripts
|
||||
cadance = mainController.UpdateCadence();
|
||||
weight = App.CurrentUser.Weight;
|
||||
bicycleWeight = App.CurrentUser.BicycleWeight;
|
||||
#if UNITY_EDITOR
|
||||
//#if UNITY_EDITOR
|
||||
System.Random rd = new System.Random();
|
||||
power = rd.Next(150, 300);//测试功率
|
||||
#endif
|
||||
power = 5000; //rd.Next(150, 300);//测试功率
|
||||
//#endif
|
||||
mainController.TrackResistance(currentSlope * App.rideSetting.sensitivity / 100);
|
||||
}
|
||||
catch (Exception)
|
||||
@@ -127,5 +131,36 @@ namespace Assets.Scenes.Ride.Scripts
|
||||
mainController.Save(TotalDistance);
|
||||
}
|
||||
#endregion
|
||||
|
||||
public void InitGraph(int index)
|
||||
{
|
||||
chartDataSourceScript.InitHorizontalScrolling(index);
|
||||
}
|
||||
//移动海拔图头像
|
||||
protected override void MoveGraphHead()
|
||||
{
|
||||
Vector3 oldPos = headPanel.transform.position;
|
||||
int nextIndex = CurrentIndex;
|
||||
var viewIndex = chartDataSourceScript.GetViewIndex(nextIndex);
|
||||
|
||||
var n = graph.DataSource.GetPoint("Player 2", viewIndex);
|
||||
graph.PointToWorldSpace(out Vector3 nextPosition, n.x, n.y, "Player 2");
|
||||
nextPosition.x -= 14f;
|
||||
nextPosition.y += 5f;
|
||||
//人物移动 停止条件 到中间且线未加载完
|
||||
if ( GetStart() && chartDataSourceScript.ReachMid(viewIndex) && !chartDataSourceScript.ReachEnd())
|
||||
{
|
||||
var currentDistance = CurrentDistance;
|
||||
var distance = Distance;
|
||||
var offset = currentDistance > 0 ? distance * 1000 / currentDistance : 1;
|
||||
graph.HorizontalScrolling += offset;
|
||||
headPanel.transform.DOMove(new Vector3(oldPos.x, nextPosition.y, 0), 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
headPanel.transform.DOMove(new Vector3(nextPosition.x, nextPosition.y, 0), 1);
|
||||
}
|
||||
headPanel.transform.SetSiblingIndex(999);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user