temp
This commit is contained in:
31
Assets/Gameplay/Scripts/GameFlowMgr/GameFlowMgr.cs
Normal file
31
Assets/Gameplay/Scripts/GameFlowMgr/GameFlowMgr.cs
Normal 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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user