diff options
| author | Andrew Lee <alee14498@protonmail.com> | 2020-08-23 18:00:57 -0400 |
|---|---|---|
| committer | Andrew Lee <alee14498@protonmail.com> | 2020-08-23 18:00:57 -0400 |
| commit | 4c192cebf7af6c271b8a8a9b10616c85ab2856dd (patch) | |
| tree | 58c30cf2b9c17172e7de535b6bd41f3e4899b176 /Assets/Scripts | |
| parent | 9a3434cce0e148b8cd86eb471cf92b5dbe425575 (diff) | |
| download | Project-Sandbox-4c192cebf7af6c271b8a8a9b10616c85ab2856dd.tar.gz Project-Sandbox-4c192cebf7af6c271b8a8a9b10616c85ab2856dd.tar.bz2 Project-Sandbox-4c192cebf7af6c271b8a8a9b10616c85ab2856dd.zip | |
Upgraded project; Main menu
Diffstat (limited to 'Assets/Scripts')
| -rw-r--r-- | Assets/Scripts/LoadScene.cs | 47 | ||||
| -rw-r--r-- | Assets/Scripts/LoadScene.cs.meta | 11 | ||||
| -rw-r--r-- | Assets/Scripts/Quit.cs | 4 |
3 files changed, 62 insertions, 0 deletions
diff --git a/Assets/Scripts/LoadScene.cs b/Assets/Scripts/LoadScene.cs new file mode 100644 index 0000000..3fbb91e --- /dev/null +++ b/Assets/Scripts/LoadScene.cs @@ -0,0 +1,47 @@ +/******************************************************************************* +* +* Unicity (Project SimLife): A Sims clone written in Unity C# +* Copyright (C) 2019 Unicity Development Team +* +* This software is protected by the copyright and licensing rights held +* by the Unicity Development Team. (2019) +* +*********************************************************************************/ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; +using UnityEngine.SceneManagement; + +public class LoadScene : MonoBehaviour { + bool doMenuRotate; + int _SceneIndex; + GameObject MainPanel; + + public void MainMenuPlayButton(int SceneIndex) { + doMenuRotate = true; + _SceneIndex = SceneIndex; + } + + public void SceneLoader(int SceneIndex) { + SceneManager.LoadScene(SceneIndex); + } + + public void Start() { + doMenuRotate = false; + MainPanel = GameObject.Find("MainPanel"); + } + + public void Update() { + if (doMenuRotate) { + if (MainPanel.transform.eulerAngles.z < 90) { + MainPanel.transform.Rotate(0, 0, MainPanel.transform.rotation.eulerAngles.z + 0.01f); + } else { + doMenuRotate = false; + } + } + + if (MainPanel.transform.eulerAngles.z > 90) { + SceneLoader(_SceneIndex); + } + } +} diff --git a/Assets/Scripts/LoadScene.cs.meta b/Assets/Scripts/LoadScene.cs.meta new file mode 100644 index 0000000..8469acd --- /dev/null +++ b/Assets/Scripts/LoadScene.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 202c899680dfb0891aa21787ff876860 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/Quit.cs b/Assets/Scripts/Quit.cs index d53343e..40cfc85 100644 --- a/Assets/Scripts/Quit.cs +++ b/Assets/Scripts/Quit.cs @@ -2,6 +2,10 @@ public class Quit : MonoBehaviour
{
+ public void ExitGame() {
+ Debug.Log("Game has closed.");
+ Application.Quit();
+ }
// Update is called once per frame
void Update()
{
|
