fix: Delete old scene controllers when switching back to the main menu
This commit is contained in:
		@@ -16,6 +16,10 @@ public class SceneController : MonoBehaviour
 | 
			
		||||
        {
 | 
			
		||||
            Instance = this;
 | 
			
		||||
        }
 | 
			
		||||
        else
 | 
			
		||||
        {
 | 
			
		||||
            Destroy(this);
 | 
			
		||||
        }
 | 
			
		||||
        // Make this object stay around when switching scenes
 | 
			
		||||
        DontDestroyOnLoad(this.gameObject);
 | 
			
		||||
        SceneManager.sceneLoaded += OnSceneLoaded;
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user