18 lines
		
	
	
		
			384 B
		
	
	
	
		
			C#
		
	
	
	
	
	
			
		
		
	
	
			18 lines
		
	
	
		
			384 B
		
	
	
	
		
			C#
		
	
	
	
	
	
| using UnityEngine;
 | |
| using UnityEngine.SceneManagement;
 | |
| 
 | |
| public class SceneSwitcher : MonoBehaviour
 | |
| {
 | |
|     public void LoadScene(string sceneName)
 | |
|     {
 | |
|         if (!string.IsNullOrEmpty(sceneName))
 | |
|         {
 | |
|             SceneManager.LoadScene(sceneName);
 | |
|         }
 | |
|         else
 | |
|         {
 | |
|             Debug.LogError("El nombre de la escena no ha sido proporcionado.");
 | |
|         }
 | |
|     }
 | |
| }
 | 
