diff options
| author | 魏曹先生 <1992414357@qq.com> | 2026-01-31 20:14:48 +0800 |
|---|---|---|
| committer | 魏曹先生 <1992414357@qq.com> | 2026-01-31 20:14:48 +0800 |
| commit | 74a4f421b436b5950e52660ba7d6ebc53a818fa5 (patch) | |
| tree | 9841fb6655fee855ba581768872de2deacf57f38 /Assets/Scripts/GameProgressManager.cs | |
| parent | 38e3e1fa64334f9cfd2f35e21439b93f525bf1b4 (diff) | |
Diffstat (limited to 'Assets/Scripts/GameProgressManager.cs')
| -rw-r--r-- | Assets/Scripts/GameProgressManager.cs | 35 |
1 files changed, 35 insertions, 0 deletions
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<SceneStatus>(); + } + + 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<PlayerMovement>().enabled = true; + player2.bindPlayer.GetComponent<PlayerMovement>().enabled = true; + } +} |
