This commit is contained in:
xinkl
2025-11-09 13:26:17 +08:00
parent 15515d7393
commit befd15e1a3
25 changed files with 1213 additions and 42 deletions

View File

@@ -0,0 +1,31 @@
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("请选择关卡");
}
SceneLoader.instance?.LoadScene(levelData.levels[levelData.currentLevelIndex].sceneName);
}
public void completeLevel(int index)
{
levelData.currentLevelIndex = ++index;
}
}