LevelData
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
using System;
|
||||
using UnityEngine;
|
||||
using Level;
|
||||
|
||||
public enum GameState
|
||||
{
|
||||
@@ -19,6 +20,9 @@ public class GameManager : MonoBehaviour
|
||||
// Public
|
||||
public GameState currentState { get; private set; } = GameState.Editing;
|
||||
|
||||
// Private
|
||||
private LevelData currentLevelData;
|
||||
|
||||
// Properties
|
||||
public static GameManager Instance => instance;
|
||||
|
||||
@@ -38,6 +42,7 @@ public class GameManager : MonoBehaviour
|
||||
// Used by button OnClick
|
||||
public void SetPlayState()
|
||||
{
|
||||
currentLevelData = LevelBuilder.Instance.CreateLevelData();
|
||||
SetState(GameState.Gameplay);
|
||||
}
|
||||
|
||||
@@ -45,11 +50,12 @@ public class GameManager : MonoBehaviour
|
||||
// Use by button OnClick
|
||||
public void SetEditState()
|
||||
{
|
||||
LevelBuilder.Instance.LoadLevelData(currentLevelData);
|
||||
SetState(GameState.Editing);
|
||||
}
|
||||
|
||||
|
||||
public void SetState(GameState newState)
|
||||
private void SetState(GameState newState)
|
||||
{
|
||||
currentState = newState;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user