diff --git a/POINT-VR-Chapter-1/Assets/POINT/InputAssets/SceneController.cs b/POINT-VR-Chapter-1/Assets/POINT/InputAssets/SceneController.cs
index 8a001932..6d0e9f5c 100644
--- a/POINT-VR-Chapter-1/Assets/POINT/InputAssets/SceneController.cs
+++ b/POINT-VR-Chapter-1/Assets/POINT/InputAssets/SceneController.cs
@@ -1,6 +1,24 @@
using UnityEngine;
using UnityEngine.SceneManagement;
using UnityEngine.UI;
+using System.Collections.Generic;
+
+///
+/// Stores integer values under scene names. Do not change these intergers (you should be changing the SceneDict dictionary below). Integers are linked to build settings scene integers in the dictionary SceneDict (defined in SceneController).
+/// There are two layers of this (enum here, and the dict down below) because the Unity Editor stores the value of the enum, not its name. So if the build settings change and you change the enum in the code then what the editor stores
+/// won't actually change.
+///
+public enum SceneNumEnum
+{
+ StartMenu = 114,
+ Tutorial = 97,
+ Ch1_Scene1 = 115,
+ Conf_Demo_P1 = 116,
+ Conf_Demo_P2 = 108,
+ Conf_Demo_P3 = 101,
+ EndCredits = 121
+}
+
///
/// This script should be on the player prefab. It communicates the player's setting to the GameManager before switching scenes and then retrieves this information upon being instantiated.
///
@@ -50,6 +68,21 @@ public class SceneController : MonoBehaviour
///
/// When Instantiated: Get the player data. Communicate this data to all component arguments.
///
+
+ ///
+ /// Relates the shown enum (left) to scene numbers in build settings. If the scene numbers in build settings change you should update
+ /// the right side of the dictionary (the values) with the new numbers.
+ ///
+ private Dictionary SceneDict = new Dictionary
+ {
+ { (int) SceneNumEnum.StartMenu, 0 },
+ { (int) SceneNumEnum.Tutorial, 1 },
+ { (int) SceneNumEnum.Ch1_Scene1, 2 },
+ { (int) SceneNumEnum.Conf_Demo_P1, 3 },
+ { (int) SceneNumEnum.Conf_Demo_P2, 4 },
+ { (int) SceneNumEnum.Conf_Demo_P3, 5 },
+ { (int) SceneNumEnum.EndCredits, 6 }
+ };
private void Start()
{
GameManager.PlayerData data = GameManager.Instance.GetData();
@@ -58,7 +91,7 @@ private void Start()
functional.value = data.functionalVolume;
aesthetic.value = data.aestheticVolume;
uiManager.Language = (int)data.language;
- uiManager.SubtitleLanguage = (int) data.subtitleLanguage;
+ uiManager.SubtitleLanguage = (int)data.subtitleLanguage;
music.mute = false;
floorToggle.IsOn = data.isFloorVisible;
hapticToggle.IsOn = data.isHapticsEnabled;
@@ -81,10 +114,16 @@ public void ChangeScene(int scene)
isHapticsEnabled = hapticToggle.IsOn,
isControllerHighlighted = highlightsToggle.IsOn,
language = (GameManager.Language)uiManager.Language,
- subtitleLanguage = (GameManager.Language) uiManager.SubtitleLanguage
+ subtitleLanguage = (GameManager.Language)uiManager.SubtitleLanguage
};
GameManager.Instance.SetData(data);
pause.Unpause();
SceneManager.LoadScene(scene);
}
-}
\ No newline at end of file
+
+ // Using a function here so the dictionary can't be modified and we don't have to bother passing larger object (I lack C# knowledge; there may be a better way to do this)
+ public int OperateSceneDict(int SceneNumEnum_number)
+ {
+ return SceneDict[SceneNumEnum_number];
+ }
+}
diff --git a/POINT-VR-Chapter-1/Assets/POINT/InputAssets/StartMenuManager.cs b/POINT-VR-Chapter-1/Assets/POINT/InputAssets/StartMenuManager.cs
index d05001ad..510a91b6 100644
--- a/POINT-VR-Chapter-1/Assets/POINT/InputAssets/StartMenuManager.cs
+++ b/POINT-VR-Chapter-1/Assets/POINT/InputAssets/StartMenuManager.cs
@@ -1,4 +1,5 @@
using System.Collections;
+using System.Collections.Generic;
using TMPro;
using UnityEngine;
using UnityEngine.UI;
@@ -24,6 +25,11 @@ public class StartMenuManager : MonoBehaviour
[Tooltip("Default localized string that appears under current objective in the UI menu")]
[SerializeField] private LocalizedString defaultObjective;
+ [SerializeField] SceneNumEnum Tutorial_Enum;
+
+ [SerializeField] SceneNumEnum End_Credits_Enum;
+
+
///
/// A reference to the player GameObject
///
@@ -242,7 +248,7 @@ public void StartGame()
SceneController sceneController = player.GetComponentInChildren();
if (sceneController != null)
{
- sceneController.ChangeScene(1);
+ sceneController.ChangeScene(sceneController.OperateSceneDict((int) Tutorial_Enum));
}
}
}
@@ -271,7 +277,7 @@ public void StartCredits()
SceneController sceneController = player.GetComponentInChildren();
if (sceneController != null)
{
- sceneController.ChangeScene(6);
+ sceneController.ChangeScene(sceneController.OperateSceneDict((int) End_Credits_Enum));
}
}
}