Assignment for RMIT Mixed Reality in 2020
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

35 lines
1.0 KiB

using System.Collections;
using System.IO;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
// Create menu of all scenes included in the build.
public class StartMenu : MonoBehaviour
{
public OVROverlay overlay;
public OVROverlay text;
public OVRCameraRig vrRig;
void Start()
{
DebugUIBuilder.instance.AddLabel("Select Sample Scene");
int n = UnityEngine.SceneManagement.SceneManager.sceneCountInBuildSettings;
for (int i = 0; i < n; ++i)
{
string path = UnityEngine.SceneManagement.SceneUtility.GetScenePathByBuildIndex(i);
var sceneIndex = i;
DebugUIBuilder.instance.AddButton(Path.GetFileNameWithoutExtension(path), () => LoadScene(sceneIndex));
}
DebugUIBuilder.instance.Show();
}
void LoadScene(int idx)
{
DebugUIBuilder.instance.Hide();
Debug.Log("Load scene: " + idx);
UnityEngine.SceneManagement.SceneManager.LoadScene(idx);
}
}