Add formatting rules

This commit is contained in:
Dries Van Schuylenbergh
2023-03-10 09:21:11 +00:00
parent 6d762a63f7
commit 26f3322e4e
30 changed files with 975 additions and 160 deletions

View File

@@ -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);