Files
unity-application/Assets/Common/Scripts/ChangeSceneOnClick.cs
2023-03-06 12:14:25 +00:00

26 lines
568 B
C#

using System.Collections;
using System.Collections.Generic;
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);
}
}