Add formatting rules
This commit is contained in:
@@ -1,21 +1,33 @@
|
||||
using UnityEngine;
|
||||
using UnityEngine.SceneManagement;
|
||||
|
||||
/// <summary>
|
||||
/// Class to handle scene loading callbacks
|
||||
/// </summary>
|
||||
public class ChangeSceneOnClick : MonoBehaviour
|
||||
{
|
||||
// Load scene from path name
|
||||
/// <summary>
|
||||
/// Method used as callback for gameobject onClick events
|
||||
/// </summary>
|
||||
/// <param name="sceneName">The path to the new scene (<c>path == $"Assets/{sceneName}"</c>)</param>
|
||||
public void LoadScene(string sceneName)
|
||||
{
|
||||
SceneManager.LoadScene(sceneName);
|
||||
}
|
||||
|
||||
// Load scene from reference
|
||||
/// <summary>
|
||||
/// Method used as callback for gameobject onClick events
|
||||
/// </summary>
|
||||
/// <param name="scene">Reference to a scene</param>
|
||||
public void LoadScene(Scene scene)
|
||||
{
|
||||
SceneManager.LoadScene(scene.buildIndex);
|
||||
}
|
||||
|
||||
// Load scene from build index
|
||||
/// <summary>
|
||||
/// Method used as callback from gameobject onClick events
|
||||
/// </summary>
|
||||
/// <param name="buildIndex">Build index of the scene to be loaded</param>
|
||||
public void LoadScene(int buildIndex)
|
||||
{
|
||||
SceneManager.LoadScene(buildIndex);
|
||||
|
||||
Reference in New Issue
Block a user