11 lines
385 B
C#
11 lines
385 B
C#
using System;
|
|
using UnityEngine;
|
|
|
|
public enum GamePhase { Menu, Loading, Playing, Results }
|
|
|
|
public sealed class GameFlowController : MonoBehaviour
|
|
{
|
|
public GamePhase Phase { get; private set; } = GamePhase.Menu;
|
|
public event Action<GamePhase> PhaseChanged;
|
|
public void SetPhase(GamePhase phase) { if (Phase == phase) return; Phase = phase; PhaseChanged?.Invoke(Phase); }
|
|
} |