aboutsummaryrefslogtreecommitdiff
path: root/Assets/Scripts/Boot.cs
blob: ddefd0bbb1e2737e00680e08d36247c2aa8ef4aa (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
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);
            }
        }
    }
}