First try

This commit is contained in:
Thorbjoern
2025-06-28 16:40:31 +02:00
parent 4facf6a768
commit 643c071c51
40 changed files with 19460 additions and 1356 deletions
+49
View File
@@ -0,0 +1,49 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;
public class GameStarter : MonoBehaviour
{
[SerializeField] int startScene = 1;
private int currentscene;
private int nextscene;
private void OnEnable()
{
StopRecordingTrigger.OnRecordStop += HandleRecordStop;
}
private void OnDisable()
{
StopRecordingTrigger.OnRecordStop -= HandleRecordStop;
}
private void Awake()
{
DontDestroyOnLoad(this);
currentscene = startScene;
}
// Update is called once per frame
void Update()
{
if (OVRInput.GetDown(OVRInput.Button.SecondaryIndexTrigger))
{
if (SceneManager.GetActiveScene() != SceneManager.GetSceneByBuildIndex(startScene)) return;
nextscene = currentscene + 1;
currentscene = nextscene;
StartGameByLoadingScene(nextscene);
}
}
void StartGameByLoadingScene(int sceneIndex)
{
SceneManager.LoadScene(sceneIndex);
}
private void HandleRecordStop()
{
StartGameByLoadingScene(startScene);
}
}