game(scripts): sceneloader -> SceneLoader
This commit is contained in:
parent
ddef973b3e
commit
cc493c7924
1 changed files with 21 additions and 0 deletions
21
Game/Assets/Scripts/SceneLoader.cs
Normal file
21
Game/Assets/Scripts/SceneLoader.cs
Normal file
|
@ -0,0 +1,21 @@
|
||||||
|
/*
|
||||||
|
* Author: Wai Lam
|
||||||
|
* Date: 7/2/25
|
||||||
|
* Description: Loading scene from start to game
|
||||||
|
*/
|
||||||
|
|
||||||
|
using UnityEngine;
|
||||||
|
using UnityEngine.SceneManagement;
|
||||||
|
|
||||||
|
public class SceneLoader : MonoBehaviour
|
||||||
|
{
|
||||||
|
public string sceneName; // Name of the scene to load
|
||||||
|
|
||||||
|
public void LoadScene()
|
||||||
|
{
|
||||||
|
if (!string.IsNullOrEmpty(sceneName))
|
||||||
|
SceneManager.LoadScene(sceneName);
|
||||||
|
else
|
||||||
|
Debug.LogWarning("Scene name is not assigned!");
|
||||||
|
}
|
||||||
|
}
|
Loading…
Add table
Reference in a new issue