Make Gamemanager

This commit is contained in:
RochesterX
2025-02-17 18:23:05 -05:00
parent fe8c8c3ef4
commit 0da9280a78
4 changed files with 62 additions and 3 deletions

View File

@@ -4,11 +4,10 @@ public class PlayerLives : MonoBehaviour
{
public int maxLives = 3;
public int currentLives;
public string gameMode = "free-for-all";
private void Start()
{
if (gameMode == "free-for-all")
if (GameManager.gameMode == GameManager.GameMode.freeForAll)
{
currentLives = maxLives;
}
@@ -19,7 +18,7 @@ public class PlayerLives : MonoBehaviour
}
public void PlayerDied()
{
if (gameMode == "free-for-all")
if (GameManager.gameMode == GameManager.GameMode.freeForAll)
{
currentLives--;
if (currentLives <= 0)