Files
DougDiggem/Assets/Scripts/GameSceneManager.cs
T
2026-03-05 20:26:22 -06:00

33 lines
849 B
C#

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<SceneDoor> 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;
}
}
}