This repository has been archived on 2025-04-11. You can view files and clone it, but cannot push or open issues or pull requests.
mochapine64backup/MoCha/Assets/Scripts/SceneLoader.cs

31 lines
532 B
C#
Raw Normal View History

2018-04-10 12:44:50 -05:00
using UnityEngine;
using UnityEngine.SceneManagement;
using System.Collections;
2018-04-12 11:10:33 -05:00
using UnityEngine.UI;
2018-04-10 12:44:50 -05:00
public class SceneLoader : MonoBehaviour {
2018-04-12 11:10:33 -05:00
Text buttontext;
public void Start()
{
buttontext = GetComponentInChildren<Text> ();
}
public void LoadScene()
2018-04-10 12:44:50 -05:00
{
2018-04-12 11:10:33 -05:00
string scenetext = buttontext.text;
switch (scenetext) {
case "Home":
SceneManager.LoadScene ("Main");
break;
case "Run":
SceneManager.LoadScene ("StepCounter");
break;
default:
SceneManager.LoadScene (scenetext);
break;
}
2018-04-10 12:44:50 -05:00
}
}