/// <summary> /// Enforces the singletone pattern, everytime an additional GameLoader is made it is destroyed to ensure there /// is only one at any given time to avoid destroying an existing game state.</summary> private void Awake() { filename = Application.persistentDataPath + "/" + filename; Inst = Inst ?? this; if (Inst != this) { Destroy(gameObject); } DontDestroyOnLoad(gameObject); }