forked from cgvr/DeltaVR
Initial Commit
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
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);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 33962741a56c2a643ba07df6c6a1c133
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Reference in New Issue
Block a user