24 lines
508 B
C#
24 lines
508 B
C#
using UnityEngine;
|
|
using UnityEngine.SceneManagement;
|
|
|
|
public class ChangeSceneOnClick : MonoBehaviour
|
|
{
|
|
// Load scene from path name
|
|
public void LoadScene(string sceneName)
|
|
{
|
|
SceneManager.LoadScene(sceneName);
|
|
}
|
|
|
|
// Load scene from reference
|
|
public void LoadScene(Scene scene)
|
|
{
|
|
SceneManager.LoadScene(scene.buildIndex);
|
|
}
|
|
|
|
// Load scene from build index
|
|
public void LoadScene(int buildIndex)
|
|
{
|
|
SceneManager.LoadScene(buildIndex);
|
|
}
|
|
}
|