This commit is contained in:
lishuo 2021-08-11 16:56:17 +08:00
parent 3fcc6c0489
commit 570bd1554f
4 changed files with 11 additions and 8 deletions

View File

@ -1,5 +1,6 @@
using Assets.Scenes.Ride.Scripts.Model; using Assets.Scenes.Ride.Scripts.Model;
using Assets.Scenes.Ride.Scripts.Model.CyclingModels; using Assets.Scenes.Ride.Scripts.Model.CyclingModels;
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using UnityEngine; using UnityEngine;
@ -137,7 +138,8 @@ namespace Assets.Scenes.Ride.Scripts
competitionRankingItem.setHead(item.Headimage); competitionRankingItem.setHead(item.Headimage);
var countryTexture = cyclingController.GetCountryImageByName(item.CountryImg); var countryTexture = cyclingController.GetCountryImageByName(item.CountryImg);
competitionRankingItem.setCountry(countryTexture); competitionRankingItem.setCountry(countryTexture);
competitionRankingItem.setDistance(currentPlayer.UserId == item.UserId?"0KM": item.Near.ToString() + "KM"); var near = Math.Round((item.EndDistance - cyclingController.currentPlayer.TotalDistance)*1000);
competitionRankingItem.setDistance(cyclingController.currentPlayer.UserId == item.UserId?"0M": near.ToString() + "M");
competitionRankingItem.transform.SetSiblingIndex(item.Index); competitionRankingItem.transform.SetSiblingIndex(item.Index);
} }
} }

View File

@ -17,14 +17,14 @@ namespace Assets.Scenes.Ride.Scripts
GameObject countDownPanel { get; set; } GameObject countDownPanel { get; set; }
Text title { get; set; } Text title { get; set; }
Text timer { get; set; } Text timer { get; set; }
GameObject raceViewBtn { get; set; }
protected override void Start() protected override void Start()
{ {
base.Start(); base.Start();
reviewPanel.SetActive(false); reviewPanel.SetActive(false);
//隐藏单人骑行时间 //隐藏单人骑行时间
var spilitLineH2 = transform.Find("Panel/ComputerPanel/SpilitLineH2").gameObject; var spilitLineH2 = transform.Find("Panel/ComputerPanel/SpilitLineH2").gameObject;
var raceViewBtn = transform.Find("Panel/RaceViewButton").gameObject; raceViewBtn = transform.Find("Panel/RaceViewButton").gameObject;
raceViewBtn.SetActive(mainController.isWatch);
viewButton.gameObject.SetActive(false); viewButton.gameObject.SetActive(false);
UIManager.AddEvent(raceViewBtn, UnityEngine.EventSystems.EventTriggerType.PointerClick, ChangeView); UIManager.AddEvent(raceViewBtn, UnityEngine.EventSystems.EventTriggerType.PointerClick, ChangeView);
@ -70,6 +70,7 @@ namespace Assets.Scenes.Ride.Scripts
private void CountDown() private void CountDown()
{ {
raceViewBtn.SetActive(mainController.isWatch);
miniMap.SetActive(false); //隐藏小地图 miniMap.SetActive(false); //隐藏小地图
//viewButton.gameObject.SetActive(false);//隐藏切换视角 //viewButton.gameObject.SetActive(false);//隐藏切换视角
headPanel.SetActive(!mainController.isWatch); //隐藏海拔图观察者的头像 headPanel.SetActive(!mainController.isWatch); //隐藏海拔图观察者的头像

View File

@ -51,7 +51,7 @@ namespace Assets.Scenes.Ride.Scripts
//显示倒计时面板信息 //显示倒计时面板信息
ShowCountDown(s.Item1, "Get The First Place. Time Limit"); ShowCountDown(s.Item1, "Get The First Place. Time Limit");
} }
else if (s.Item1 > 0) else if (s.Item1 >= 0)
{ {
//显示倒计时面板信息 //显示倒计时面板信息
//ShowCountDown(s.Item1, "remaining"); //ShowCountDown(s.Item1, "remaining");

View File

@ -55,10 +55,10 @@ namespace Assets.Scenes.Ride.Scripts
cadance = mainController.UpdateCadence(); cadance = mainController.UpdateCadence();
weight = App.CurrentUser.Weight; weight = App.CurrentUser.Weight;
bicycleWeight = App.CurrentUser.BicycleWeight; bicycleWeight = App.CurrentUser.BicycleWeight;
//#if UNITY_EDITOR #if UNITY_EDITOR
power = 500; power = 500;
//#endif #endif
mainController.TrackResistance(currentSlope * App.RideSetting.Sensitivity / 100); mainController.TrackResistance(currentSlope * App.RideSetting.Sensitivity / 100);
} }
catch (Exception ex) catch (Exception ex)
{ {