From 8475753cafd825a937e45336e4d8bafd5c6e4643 Mon Sep 17 00:00:00 2001 From: 魏曹先生 <1992414357@qq.com> Date: Sun, 1 Feb 2026 11:19:03 +0800 Subject: aaa --- Assets/Scripts/UI/UIBinding.cs | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) (limited to 'Assets/Scripts') diff --git a/Assets/Scripts/UI/UIBinding.cs b/Assets/Scripts/UI/UIBinding.cs index 9830b03..2856393 100644 --- a/Assets/Scripts/UI/UIBinding.cs +++ b/Assets/Scripts/UI/UIBinding.cs @@ -18,6 +18,10 @@ namespace UI public Image player1ScoreDisplay; public Image player2ScoreDisplay; + public GameObject noPlayerJoinedLayer; + public GameObject player1JoinedLayer; + public GameObject allPlayerJoinedLayer; + private void FixedUpdate() { // 更新时间文本 @@ -39,6 +43,42 @@ namespace UI // 更新问题显示 questionText.text = progress.questionPlayer.currentQuestion.QuestionText; + + // 更新玩家加入显示 + if (progress.sceneStatus.current == Status.Waiting) + { + var player1Joined = progress.player1.bindPlayer != null; + var player2Joined = progress.player2.bindPlayer != null; + + if (!player1Joined && !player2Joined) + { + noPlayerJoinedLayer.SetActive(true); + player1JoinedLayer.SetActive(false); + allPlayerJoinedLayer.SetActive(false); + return; + } + + if (player1Joined && !player2Joined) + { + noPlayerJoinedLayer.SetActive(false); + player1JoinedLayer.SetActive(true); + allPlayerJoinedLayer.SetActive(false); + return; + } + + if (player1Joined && player2Joined) + { + noPlayerJoinedLayer.SetActive(false); + player1JoinedLayer.SetActive(false); + allPlayerJoinedLayer.SetActive(true); + } + } + else + { + noPlayerJoinedLayer.SetActive(false); + player1JoinedLayer.SetActive(false); + allPlayerJoinedLayer.SetActive(false); + } } } } -- cgit