Files
SoulliesOfficial 50ee502684 完善
2026-02-13 09:22:11 -05:00

26 lines
868 B
C#
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
using UnityEngine.SceneManagement;
namespace Cielonos.Core.SceneManagement
{
public static class SceneBus
{
// 硬编码 Loading 场景的名字,防止手误
private const string LoadingSceneName = "Loading";
// 暂存目标场景的名字
public static string TargetSceneName { get; private set; }
/// <summary>
/// 外部调用的唯一入口。
/// 例如:在 Menu 场景点击开始游戏时调用 GameSceneManager.LoadScene("MainGame");
/// </summary>
public static void LoadScene(string sceneName)
{
TargetSceneName = sceneName;
// 这里我们加载 Loading 场景
// 注意Loading 场景本身必须非常轻量,确保能瞬间加载完毕
SceneManager.LoadScene(LoadingSceneName);
}
}
}