using UnityEngine; public class GameManager : MonoBehaviour { public static GameManager Instance { get; private set; } public DialogueManager DialogueManager { get; private set; } 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; DontDestroyOnLoad(gameObject); DialogueManager = GetComponent(); } } }