watch按钮只读样式

This commit is contained in:
lishuo 2021-09-16 20:35:12 +08:00
parent e6e519d166
commit 9b0c86aefb

View File

@ -85,7 +85,7 @@ namespace Assets.Scenes.Ride.Scripts
//3.开始按钮 //3.开始按钮
rideNow.gameObject.SetActive(_canEnter); rideNow.gameObject.SetActive(_canEnter);
//4.详情按钮 //4.详情按钮
Detail.SetActive(!_canEnter); Detail.SetActive(!_canEnter && !_canWatch);
//5.取消报名按钮 (比赛开始前可以取消报名) //5.取消报名按钮 (比赛开始前可以取消报名)
CancelJoin.SetActive(_canCancelApply); CancelJoin.SetActive(_canCancelApply);
@ -98,7 +98,7 @@ namespace Assets.Scenes.Ride.Scripts
CompetitionStatus.text = competition.StatusVlaue.ToString(); CompetitionStatus.text = competition.StatusVlaue.ToString();
} }
Watch.GetComponent<Button>().enabled = process>=100; //Watch.GetComponent<Button>().enabled = process>=100;
Watch.GetComponent<Button>().interactable = process >= 100; Watch.GetComponent<Button>().interactable = process >= 100;
} }
#endregion #endregion
@ -149,7 +149,8 @@ namespace Assets.Scenes.Ride.Scripts
Watcher = Resources.Load<GameObject>("UI/Prefab/Match/Watcher"); Watcher = Resources.Load<GameObject>("UI/Prefab/Match/Watcher");
MoreHead = Resources.Load<GameObject>("UI/Prefab/Match/MoreHead"); MoreHead = Resources.Load<GameObject>("UI/Prefab/Match/MoreHead");
#endif #endif
Watch.GetComponent<Button>().enabled = false; //Watch.GetComponent<Button>().enabled = false;
Watch.GetComponent<Button>().interactable = false; Watch.GetComponent<Button>().interactable = false;
UIManager.AddEvent(ReadMore, EventTriggerType.PointerClick, ReadCompetitionPreview); UIManager.AddEvent(ReadMore, EventTriggerType.PointerClick, ReadCompetitionPreview);
@ -267,6 +268,8 @@ namespace Assets.Scenes.Ride.Scripts
//观察 //观察
protected void StartWatch(BaseEventData baseEvent) protected void StartWatch(BaseEventData baseEvent)
{ {
if (!Watch.GetComponent<Button>().interactable)
return;
UpdateCompetition(); UpdateCompetition();
if (competition.Status == 4) if (competition.Status == 4)
{ {
@ -323,7 +326,7 @@ namespace Assets.Scenes.Ride.Scripts
Utils.showToast(gameObject, rrr.errMsg); Utils.showToast(gameObject, rrr.errMsg);
} }
rideNow.gameObject.SetActive(_canStart); rideNow.gameObject.SetActive(_canStart);
Detail.SetActive(!_canStart); Detail.SetActive(!_canStart && !_canWatch);
UIManager.CloseConfirm(); UIManager.CloseConfirm();
}); });