wirm/Game/Assets/Scripts/Sceneloader.cs
2025-02-07 14:14:57 +08:00

26 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!");
}
}
}