27 lines
547 B
C#
27 lines
547 B
C#
![]() |
/*
|
||
|
Author: Wai Lam
|
||
|
Date: 7/2/25
|
||
|
Description: Loading scene from start to game
|
||
|
*/
|
||
|
using System.Collections;
|
||
|
using System.Collections.Generic;
|
||
|
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!");
|
||
|
}
|
||
|
}
|
||
|
}
|