Files
2025-11-09 18:00:06 +08:00

34 lines
905 B
C#

using A2W;
using UnityEngine;
public class GameFlowMgr : Singleton<GameFlowMgr>
{
// Start is called once before the first execution of Update after the MonoBehaviour is created
public LevelData levelData;
void Start()
{
levelData = Resources.Load<LevelData>("LevelData/LevelData");
Debug.Log(levelData.levels.Count);
}
// Update is called once per frame
void Update()
{
}
public void StartGame()
{
if (levelData.currentLevelIndex < 0)
{
throw new System.Exception("请选择关卡");
}
Debug.Log(levelData.levels[levelData.currentLevelIndex].sceneName);
StageSelector.EnterStage(levelData.levels[levelData.currentLevelIndex].sceneName);
}
public void completeLevel(int index)
{
levelData.currentLevelIndex = ++index;
StageSelector.EnterStage("Stage1");
}
}