summaryrefslogtreecommitdiff
path: root/Assets/Scripts/GameProgressManager.cs
diff options
context:
space:
mode:
author魏曹先生 <1992414357@qq.com>2026-01-31 20:14:48 +0800
committer魏曹先生 <1992414357@qq.com>2026-01-31 20:14:48 +0800
commit74a4f421b436b5950e52660ba7d6ebc53a818fa5 (patch)
tree9841fb6655fee855ba581768872de2deacf57f38 /Assets/Scripts/GameProgressManager.cs
parent38e3e1fa64334f9cfd2f35e21439b93f525bf1b4 (diff)
完成好多HEADmain
Diffstat (limited to 'Assets/Scripts/GameProgressManager.cs')
-rw-r--r--Assets/Scripts/GameProgressManager.cs35
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;
+ }
+}