blob: c514abe0c91c6cc6389c7633c04cff2c9adf4ed5 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
using UnityEngine;
using UnityEngine.SceneManagement;
public class LoadSceneOnTop : MonoBehaviour
{
[SerializeField]
private string sceneNameToLoad;
private void Start()
{
LoadScene();
}
public void LoadScene()
{
if (!string.IsNullOrEmpty(sceneNameToLoad))
{
SceneManager.LoadScene(sceneNameToLoad, LoadSceneMode.Additive);
}
else
{
Debug.LogError("Scene name is not specified. Please provide a valid scene name.");
}
}
}
|