Initial Commit

This commit is contained in:
2026-03-16 14:38:46 +02:00
commit b8f7327a21
2327 changed files with 253610 additions and 0 deletions
+61
View File
@@ -0,0 +1,61 @@
using System;
using UnityEngine;
using Zenject;
namespace FlappyBird.Core
{
public class GameManager : IGameManager, IInitializable
{
public GameState CurrentState { get; private set; } = GameState.Menu;
public event Action<GameState> OnGameStateChanged;
public void Initialize()
{
CurrentState = GameState.Menu;
Debug.Log($"Gameplay state: {CurrentState}");
}
public void StartGame()
{
if (CurrentState != GameState.Menu)
{
return;
}
TransitionTo(GameState.Playing);
}
public void GameOver()
{
if (CurrentState != GameState.Playing)
{
return;
}
TransitionTo(GameState.GameOver);
}
public void ReturnToMenu()
{
if (CurrentState == GameState.Menu)
{
return;
}
TransitionTo(GameState.Menu);
}
private void TransitionTo(GameState state)
{
if (CurrentState == state)
{
return;
}
CurrentState = state;
Debug.Log($"Gameplay state: {CurrentState}");
OnGameStateChanged?.Invoke(CurrentState);
}
}
}