diff --git a/MoCha/Assets/Prefabs/Canvas.prefab b/MoCha/Assets/Prefabs/Canvas.prefab index 4571dfd..e8b0feb 100644 Binary files a/MoCha/Assets/Prefabs/Canvas.prefab and b/MoCha/Assets/Prefabs/Canvas.prefab differ diff --git a/MoCha/Assets/Scenes/Stats.unity b/MoCha/Assets/Scenes/Stats.unity index 040d036..92ae7cd 100644 Binary files a/MoCha/Assets/Scenes/Stats.unity and b/MoCha/Assets/Scenes/Stats.unity differ diff --git a/MoCha/Assets/Scripts/SceneLoader.cs b/MoCha/Assets/Scripts/SceneLoader.cs index abb59ae..f372dd3 100644 --- a/MoCha/Assets/Scripts/SceneLoader.cs +++ b/MoCha/Assets/Scripts/SceneLoader.cs @@ -1,11 +1,31 @@ using UnityEngine; using UnityEngine.SceneManagement; using System.Collections; +using UnityEngine.UI; public class SceneLoader : MonoBehaviour { - public void LoadScene(int scene) + Text buttontext; + + public void Start() + { + buttontext = GetComponentInChildren (); + } + + public void LoadScene() { - SceneManager.LoadScene(scene); + string scenetext = buttontext.text; + + switch (scenetext) { + case "Home": + SceneManager.LoadScene ("Main"); + break; + case "Run": + SceneManager.LoadScene ("StepCounter"); + break; + default: + SceneManager.LoadScene (scenetext); + break; + } } } \ No newline at end of file