From 74a4f421b436b5950e52660ba7d6ebc53a818fa5 Mon Sep 17 00:00:00 2001 From: 魏曹先生 <1992414357@qq.com> Date: Sat, 31 Jan 2026 20:14:48 +0800 Subject: 完成好多 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Assets/Scripts/GameProgressManager.cs | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 Assets/Scripts/GameProgressManager.cs (limited to 'Assets/Scripts/GameProgressManager.cs') diff --git a/Assets/Scripts/GameProgressManager.cs b/Assets/Scripts/GameProgressManager.cs new file mode 100644 index 0000000..463e2b3 --- /dev/null +++ b/Assets/Scripts/GameProgressManager.cs @@ -0,0 +1,35 @@ +using Tag; +using UnityEngine; + +[RequireComponent(typeof(SceneStatus))] +public class GameProgressManager : MonoBehaviour +{ + public MaskAnswers player1; + public MaskAnswers player2; + + public SceneStatus sceneStatus; + + private void Awake() + { + sceneStatus = GetComponent(); + } + + public void Refresh() + { + if (player1.bindPlayer != null && + player2.bindPlayer != null && + SceneStatus.Instance.current == Status.Waiting) + { + // 开始游戏 + sceneStatus.current = Status.Playing; + OnGameStart(); + } + } + + private void OnGameStart() + { + Debug.Log("开始游戏!"); + player1.bindPlayer.GetComponent().enabled = true; + player2.bindPlayer.GetComponent().enabled = true; + } +} -- cgit