diff options
author | Carson Katri <carson.katri@gmail.com> | 2021-06-13 01:07:20 -0400 |
---|---|---|
committer | Carson Katri <carson.katri@gmail.com> | 2021-06-13 01:07:20 -0400 |
commit | f2ea922dfd57bdbd64a0091eab3b97f936281343 (patch) | |
tree | ae56f5106566f1b2bf676d48566d9f1568f13ed8 /Assets/Scripts | |
parent | af13ca7f36f617c95e3932bb3282e7a5ffa8d2fe (diff) | |
download | gmtk-gamejam-f2ea922dfd57bdbd64a0091eab3b97f936281343.tar.gz gmtk-gamejam-f2ea922dfd57bdbd64a0091eab3b97f936281343.tar.zst gmtk-gamejam-f2ea922dfd57bdbd64a0091eab3b97f936281343.zip |
Add main menu
Diffstat (limited to 'Assets/Scripts')
-rw-r--r-- | Assets/Scripts/Controllers/GameController.cs | 2 | ||||
-rw-r--r-- | Assets/Scripts/Controllers/MenuController.cs | 14 | ||||
-rw-r--r-- | Assets/Scripts/Controllers/MenuController.cs.meta | 11 |
3 files changed, 26 insertions, 1 deletions
diff --git a/Assets/Scripts/Controllers/GameController.cs b/Assets/Scripts/Controllers/GameController.cs index 4bdae38..739f76c 100644 --- a/Assets/Scripts/Controllers/GameController.cs +++ b/Assets/Scripts/Controllers/GameController.cs @@ -20,7 +20,7 @@ namespace Controllers public bool freezeMotion; private float startTime; - [SerializeField] private float timeLimit; + public static float timeLimit; /// <summary> /// The single ball for the game. diff --git a/Assets/Scripts/Controllers/MenuController.cs b/Assets/Scripts/Controllers/MenuController.cs new file mode 100644 index 0000000..ce1da25 --- /dev/null +++ b/Assets/Scripts/Controllers/MenuController.cs @@ -0,0 +1,14 @@ +using UnityEngine; +using UnityEngine.SceneManagement; + +namespace Controllers +{ + public class MenuController : MonoBehaviour + { + public void StartRound(int minutes) + { + GameController.timeLimit = minutes * 60f; + SceneManager.LoadScene("Main"); + } + } +} diff --git a/Assets/Scripts/Controllers/MenuController.cs.meta b/Assets/Scripts/Controllers/MenuController.cs.meta new file mode 100644 index 0000000..2bb6455 --- /dev/null +++ b/Assets/Scripts/Controllers/MenuController.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 2a9ec055a8d57425094584160f11bbf8 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: |