倒计时的算法及界面调整
This commit is contained in:
1 parent
bea0e40ec1
commit
074200cb4f
16 files changed
+2714
-2596
No files matched your search
@@ -172,7 +172,7 @@ namespace Assets.Scenes.Ride.Scripts
|
||||
//平均破度
|
||||
slope.text = Math.Round(route.AverageGrade, 2).ToString() + "%";
|
||||
//比赛开始时间
|
||||
StartTime.text = competition.StartTime.ToLocalTime().ToString()+"-"+ competition.EndApplyTime.ToLocalTime().ToString();
|
||||
StartTime.text = competition.StartTime.ToLocalTime().ToString()+" TO "+ competition.EndApplyTime.ToLocalTime().ToString();
|
||||
//比赛结束时间
|
||||
// EndTime.text = competition.EndTime.ToLocalTime().ToString();
|
||||
//比赛状态
|
||||
@@ -282,6 +282,7 @@ namespace Assets.Scenes.Ride.Scripts
|
||||
_canCancelApply = competition.CanCancelJoin;
|
||||
_canWatch = competition.CanWatch;
|
||||
_raceStart = competition.Status == 3;
|
||||
_canEnter = competition.CanEnter;
|
||||
|
||||
Contestant.text = competition.UserList.Count.ToString() + "Riders";
|
||||
ShowPlayers(competition.UserList);
|
||||
|
||||
@@ -65,7 +65,7 @@ namespace Assets.Scenes.Ride.Scripts
|
||||
if (rankingList == null) return;
|
||||
//当前参赛总人数
|
||||
var totalCount = rankingList.Count();
|
||||
OnlineUserNum.text = totalCount.ToString();
|
||||
OnlineUserNum.text = " "+totalCount.ToString();
|
||||
//当前用户排名
|
||||
var currentIndex = rankingList.Where(c => c.UserId == cyclingController.currentPlayer.UserId).FirstOrDefault()?.Index ?? 0;
|
||||
totalPages = (pageSize>0?totalCount / pageSize:0) + (totalCount % pageSize> 0? 1:0);
|
||||
|
||||
@@ -16,7 +16,6 @@ namespace Assets.Scenes.Ride.Scripts
|
||||
|
||||
CompetitionModel competitionModel { get; set; }
|
||||
CyclingController cyclingController { get; set; }
|
||||
|
||||
private void Start()
|
||||
{
|
||||
cyclingController = FindObjectOfType<CyclingController>();
|
||||
@@ -25,6 +24,7 @@ namespace Assets.Scenes.Ride.Scripts
|
||||
TimerTitle = transform.Find("ConpetitionTimerTitle").GetComponent<Text>();
|
||||
Timer = transform.Find("ConpetitionTimer").GetComponent<Text>();
|
||||
competitionModel = cyclingController.cyclingController as CompetitionModel;
|
||||
|
||||
}
|
||||
GameObject competitionResultPanel { get; set; }
|
||||
|
||||
@@ -46,10 +46,10 @@ namespace Assets.Scenes.Ride.Scripts
|
||||
var isAutoSave = s.Item1 <= 0 && !cyclingController.cyclingController.recorderData.Saved && !cyclingController.isWatch;
|
||||
|
||||
//显示关门时间
|
||||
if (s.Item2 && !isAutoSave)
|
||||
if (s.Item3 && !isAutoSave)
|
||||
{
|
||||
//显示倒计时面板信息
|
||||
ShowCountDown(s.Item1, "Get The First Place. Time Limit:");
|
||||
ShowCountDown(s.Item1, "Get The First Place. Time Limit");
|
||||
}
|
||||
else if (s.Item1 > 0)
|
||||
{
|
||||
@@ -60,7 +60,7 @@ namespace Assets.Scenes.Ride.Scripts
|
||||
//显示当前选手骑行时间
|
||||
Timer.gameObject.SetActive(true);
|
||||
TimerTitle.gameObject.SetActive(true);
|
||||
Timer.text = Helper.FormatTicks(cyclingController.currentPlayer.TotalTicks);
|
||||
Timer.text = Helper.FormatTicks(s.Item2);// Helper.FormatTicks(cyclingController.currentPlayer.TotalTicks);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user