using System.Collections.Generic; using UnityEngine; // Manages scene-specific info, WILL be destroyed on load, and there is one of these // in each scene public class GameSceneManager : MonoBehaviour { public static GameSceneManager Instance { get; private set; } // This is a list of doors that take us to different scenes. We'll use this // to tell the GameManager which door to put us at when we enter a new scene. public List SceneDoors; public SceneDoor GetDoorWithId(int id) { return SceneDoors.Find(x => x.DoorId == id); } private void Awake() { // If there is an instance, and it's not me, delete myself. if (Instance != null && Instance != this) { Destroy(this); } else { Instance = this; } } }