aboutsummaryrefslogtreecommitdiff
path: root/Assets/Scripts/Boot.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Assets/Scripts/Boot.cs')
-rw-r--r--Assets/Scripts/Boot.cs23
1 files changed, 23 insertions, 0 deletions
diff --git a/Assets/Scripts/Boot.cs b/Assets/Scripts/Boot.cs
new file mode 100644
index 0000000..ddefd0b
--- /dev/null
+++ b/Assets/Scripts/Boot.cs
@@ -0,0 +1,23 @@
+using System.Collections.Generic;
+using UnityEngine;
+using UnityEngine.SceneManagement;
+#if UNITY_EDITOR
+using UnityEditor;
+#endif
+
+public class SceneLoader : MonoBehaviour
+{
+ [SerializeField] private List<SceneAsset> scenes;
+
+ private void Awake()
+ {
+ foreach (var sceneAsset in scenes)
+ {
+ string sceneName = sceneAsset.name;
+ if (!SceneManager.GetSceneByName(sceneName).isLoaded)
+ {
+ SceneManager.LoadSceneAsync(sceneName, LoadSceneMode.Additive);
+ }
+ }
+ }
+} \ No newline at end of file