本地记录重新上传,一些界面bug修复
This commit is contained in:
1 parent
470d52b1bc
commit
f1eeb11543
11 files changed
+6363
-3355
No files matched your search
@@ -403,42 +403,31 @@ namespace Assets.Scenes.Ride.Scripts
|
||||
nextSlopeDistanceText.text = $"{Math.Round(playerController.NextSlopeTotalDistance, 0)}M";
|
||||
currentSlopeText.text = Math.Round(playerController.CurrentSlope, 1).ToString() + "%";
|
||||
currentSlopeDistanceText.GetComponent<NumberDotween>().AnimateNum((float)playerController.CurrentSlopeDistance, Math.Round(playerController.CurrentDistance, 0), playerController.CurrentIndex, 0, "{0}M", currentSlopeProcess);
|
||||
currentSlopeDistanceText.GetComponent<NumberDotween>().AnimateNumText((float)playerController.CurrentDistance - (float)playerController.CurrentSlopeDistance, Math.Round(playerController.CurrentDistance, 0), playerController.CurrentIndex, 0, "{0}M", currentSlopeProcess);
|
||||
totalClimb.text = Math.Round(playerController.TotalClimb, 0).ToString();
|
||||
//小地图进度
|
||||
var process = (float)(playerController.TotalDistance / routeInstance.Distance);
|
||||
miniMapProcess.fillAmount = process;
|
||||
miniMapProcessText.text = $"{process*100:f0}%";
|
||||
//动态改变坡度图片
|
||||
ChangeSlopeImage();
|
||||
ChangeSlopeImage(nextSlopeImage, playerController.NextSlope);
|
||||
ChangeSlopeImage(currentSlopeImage, playerController.CurrentSlope);
|
||||
}
|
||||
}
|
||||
|
||||
private void ChangeSlopeImage()
|
||||
private void ChangeSlopeImage(Image image,double slope)
|
||||
{
|
||||
if (playerController.CurrentSlope >= 1)
|
||||
if (slope >= 1)
|
||||
{
|
||||
currentSlopeImage.sprite = uphill1;
|
||||
image.sprite = uphill1;
|
||||
}
|
||||
else if (playerController.CurrentSlope > -1 || playerController.CurrentSlope < 1)
|
||||
else if (slope > -1 && slope < 1)
|
||||
{
|
||||
currentSlopeImage.sprite = straight;
|
||||
image.sprite = straight;
|
||||
}
|
||||
else
|
||||
{
|
||||
currentSlopeImage.sprite = downhill1;
|
||||
}
|
||||
//下一个坡度
|
||||
if (playerController.NextSlope >= 1)
|
||||
{
|
||||
nextSlopeImage.sprite = uphill1Small;
|
||||
}
|
||||
else if (playerController.NextSlope > -1 || playerController.NextSlope < 1)
|
||||
{
|
||||
nextSlopeImage.sprite = straightSmall;
|
||||
}
|
||||
else
|
||||
{
|
||||
nextSlopeImage.sprite = downhill1Small;
|
||||
image.sprite = downhill1;
|
||||
}
|
||||
}
|
||||
//重置游戏
|
||||
|
||||
Reference in new issue
Block a user