修复比赛结束时观察者模式看不到结果&观察者不用连接设备
This commit is contained in:
parent
4a8239a2db
commit
978debcd23
File diff suppressed because it is too large
Load Diff
@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 3ce179eef26cbf94ba2bd307690e4beb
|
||||
guid: 2fe2d472537f7874797d676190b7255a
|
||||
PrefabImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
|
||||
@ -54,6 +54,7 @@ namespace Assets.Scenes.Ride.Scripts
|
||||
{
|
||||
Background.color = selectedColor;
|
||||
Ratio.color = Color.white;
|
||||
Distance.color = Color.white;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@ -164,7 +164,7 @@ namespace Assets.Scenes.Ride.Scripts.Model.CyclingModels
|
||||
|
||||
#region 骑行结束,比赛结果展示数据
|
||||
var results = new List<CompetitionResultModel>();
|
||||
if (recorderData.IsCompleted || recorderData.Saved || mapCompetition.HasRecord)
|
||||
if (recorderData.IsCompleted || recorderData.Saved || mapCompetition.HasRecord || CanQuit())
|
||||
{
|
||||
var users1 = userList.Where(d => d.IsCompleted || d.Saved);
|
||||
if ((users1.Any() && users1.Any(d => mapWorkoutRecordRankings.All(u => u.UserId != d.Id)))
|
||||
@ -311,12 +311,14 @@ namespace Assets.Scenes.Ride.Scripts.Model.CyclingModels
|
||||
//关门时间到了退出骑行场景
|
||||
public bool CanQuit()
|
||||
{
|
||||
if (mapCompetition?.FirstEndTime.HasValue??false)
|
||||
var end1 = (int)Math.Floor((mapCompetition.EndTime.ToLocalTime() - Now).TotalSeconds);
|
||||
if (!FirstEndTime.HasValue)
|
||||
{
|
||||
var closeDateTime = mapCompetition?.FirstEndTime.Value.ToLocalTime().AddMinutes(mapCompetition?.CloseTime??0 );
|
||||
return Now >= closeDateTime;
|
||||
return end1 <= 0;
|
||||
}
|
||||
return false;
|
||||
|
||||
var end2 = (int)Math.Floor((FirstEndTime.Value.ToLocalTime().AddMinutes(mapCompetition.CloseTime) - Now).TotalSeconds);
|
||||
return end2 <= 0;
|
||||
}
|
||||
|
||||
public bool CanStart()
|
||||
|
||||
@ -171,7 +171,7 @@ namespace Assets.Scenes.Ride.Scripts
|
||||
#if UNITY_EDITOR
|
||||
checkAnt = true;
|
||||
#endif
|
||||
if (!checkAnt)
|
||||
if (!checkAnt && !cyclingController.isWatch)
|
||||
{
|
||||
var alert = (GameObject)Instantiate(Resources.Load("UI/Prefab/Ride/Alert"), panel.transform);
|
||||
alert.SetActive(true);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user