细节调整

This commit is contained in:
lishuo committed 2021-04-25 19:41:35 +08:00
1 parent bbc3deeef2
commit 02b8f97d83
16 files changed
+3692 -3565

No files matched your search

+48 -19
View File
@@ -305,7 +305,7 @@ namespace Assets.Scenes.Ride.Scripts
}
private void ShadowRide(BaseEventData baseEventData)
{
mainController.SetCyclingModel(CyclingModel.Review);
//mainController.SetCyclingModel(CyclingModel.Review);
selectPanel.SetActive(false);
//显示影子选手骑行列表
selectPlayer.SetActive(true);
@@ -411,8 +411,8 @@ namespace Assets.Scenes.Ride.Scripts
{
clearLock = true;
isSimple *= -1;
simpleBtn.targetGraphic = simpleBtn.image;
simpleBtn.image.sprite = isSimple == -1? Resources.Load<Sprite>("Images/Ride/full") : Resources.Load<Sprite>("Images/Ride/simple");
simpleBtn.transform.GetComponent<Image>().sprite = isSimple == -1 ? Resources.Load<Sprite>("Images/Ride/full") : Resources.Load<Sprite>("Images/Ride/simple");
};
}
}
@@ -534,32 +534,61 @@ namespace Assets.Scenes.Ride.Scripts
void MoveChartMarkPoint()
{
Vector3 prePosition = img.transform.position;
int nextIndex = playerController.CurrentIndex+1;
int nextIndex = playerController.CurrentIndex;
double ditance = playerController.Distance;//当前移动距离
double currentDistance = playerController.CurrentDistance;//当前区间距离
var t = currentDistance != 0 ? ditance*1000 / currentDistance : 0;
var t = currentDistance != 0 ? ditance*1000 / currentDistance : 1;
var n = graph.DataSource.GetPoint("Player 2", nextIndex);
graph.PointToWorldSpace(out Vector3 nextPosition, n.x, n.y, "Player 2");
//var currentPos = Vector3.Lerp(prePosition, nextPosition, (float)t);
if (mainController.isStart)
{
var ss = graph.GetComponentInChildren<ChartDataSourceScript>();
if (ss.total <= ss.DownSampleToPoints)
{
img.transform.DOMove(new Vector3(nextPosition.x, nextPosition.y, 0), 0);
}
else
{ //人 - 线(中点) - 人(ss.total - graph.HorizontalScrolling <100)
//人物移动到中间的时候,线开始向左边平滑移动
var mapData = mainController.GetMapData();
//线移动
var interval = ditance / mapData.TotalDistance * ss.total;
//线到头了开始移动人物
var s = (ss.total - graph.HorizontalScrolling);
img.transform.DOMove(new Vector3(nextPosition.x, nextPosition.y, 0), 1);
//if (s < 200)
//{
//}
//else
//{
// graph.HorizontalScrolling = nextIndex + 1 - t;
// img.transform.DOMove(new Vector3(prePosition.x, currentPos.y, 0), 1);
//}
}
}
//else
//{
// //人移动 当前中间的时候开始切换线移动
// img.transform.DOMove(new Vector3(currentPos.x, currentPos.y, 0), 0);
// //线快加载五年的时候
//}
//线即将加载完
var currentPos = Vector3.Lerp(prePosition, nextPosition, (float)t);
img.transform.DOMove(currentPos, 1);
var ss = graph.GetComponentInChildren<ChartDataSourceScript>();
var q = ss.pageStartThreshold;
var p = ss.pageEndThreshold;
var diff = currentPos.x - prePosition.x;
var s = graph.ScrollableData;
var sss = s.GetMaxValue(0, true);
Debug.Log(sss);
//graph.HorizontalScrolling += diff / graph.TotalWidth;
//人物移动到中间的时候,线开始向左边平滑移动
//int del = (int)Math.Round(graph.DataSource.HorizontalViewSize / 2, 0);
//if (playerController.CurrentIndex % del == 0)
//{
// graph.HorizontalScrolling += 1;
//}
#region 注释
#region 注释
//var dataPoints = elevationChart.series.list[0].dataPoints.OrderBy(c => c.x).ToList();
//if (dataPoints.Count > 0)
//{
@@ -582,7 +611,7 @@ namespace Assets.Scenes.Ride.Scripts
// //testButton.transform.DOLocalMove(new Vector3(pointMap[playerController.CurrentIndex - 1].x-Screen.width/2, pointMap[playerController.CurrentIndex - 1].y, 0),0.5f);
// //pointMap.Remove(playerController.CurrentIndex - 1);
//}
#endregion
#endregion
}
}
}