Removed TOTU 103
This commit is contained in:
		
							
								
								
									
										23
									
								
								Assets/Scripts/DebugLogger/PersistentSceneManager.cs
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										23
									
								
								Assets/Scripts/DebugLogger/PersistentSceneManager.cs
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,23 @@ | ||||
| using UnityEngine; | ||||
| using UnityEngine.SceneManagement; | ||||
|  | ||||
| public class PersistentSceneManager : MonoBehaviour | ||||
| { | ||||
|     private static bool isInitialized = false; | ||||
|  | ||||
|     private void Awake() | ||||
|     { | ||||
|         if (!isInitialized) | ||||
|         { | ||||
|             DontDestroyOnLoad(gameObject); // Previene la destrucci<63>n de este objeto al cambiar de escena | ||||
|             isInitialized = true; | ||||
|  | ||||
|             // Cargar la escena principal en modo aditivo | ||||
|             SceneManager.LoadScene("MainScreen", LoadSceneMode.Additive); | ||||
|         } | ||||
|         else | ||||
|         { | ||||
|             Destroy(gameObject); // Evitar duplicados | ||||
|         } | ||||
|     } | ||||
| } | ||||
		Reference in New Issue
	
	Block a user
	 Ignacio Gómez Puga
					Ignacio Gómez Puga