Cleaned up and commented version.

This commit is contained in:
Thorbjoern
2025-10-02 00:07:11 +02:00
parent 2b86d9f0a2
commit 4c613c3436
66 changed files with 260 additions and 1020 deletions
@@ -0,0 +1,51 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;
// Ehemaliges Skript für die Start-Szene. Nicht mehr in Verwendung
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);
}
}