Merge branch 'main' of https://github.com/RochesterX/Sophomore-Project
This commit is contained in:
4294
Assets/Scenes/Platform2.unity
Normal file
4294
Assets/Scenes/Platform2.unity
Normal file
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
13
Assets/Scripts/GameManager.cs
Normal file
13
Assets/Scripts/GameManager.cs
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
using UnityEngine;
|
||||||
|
|
||||||
|
public class GameManager : MonoBehaviour
|
||||||
|
{
|
||||||
|
public enum GameMode
|
||||||
|
{
|
||||||
|
freeForAll,
|
||||||
|
teamDeathmatch,
|
||||||
|
captureTheFlag
|
||||||
|
}
|
||||||
|
|
||||||
|
public static GameMode gameMode = GameMode.freeForAll;
|
||||||
|
}
|
||||||
2
Assets/Scripts/GameManager.cs.meta
Normal file
2
Assets/Scripts/GameManager.cs.meta
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: d6e4006937b044c9ab3de25a7ab68162
|
||||||
@@ -4,11 +4,10 @@ public class PlayerLives : MonoBehaviour
|
|||||||
{
|
{
|
||||||
public int maxLives = 3;
|
public int maxLives = 3;
|
||||||
public int currentLives;
|
public int currentLives;
|
||||||
public string gameMode = "free-for-all";
|
|
||||||
|
|
||||||
private void Start()
|
private void Start()
|
||||||
{
|
{
|
||||||
if (gameMode == "free-for-all")
|
if (GameManager.gameMode == GameManager.GameMode.freeForAll)
|
||||||
{
|
{
|
||||||
currentLives = maxLives;
|
currentLives = maxLives;
|
||||||
}
|
}
|
||||||
@@ -19,7 +18,7 @@ public class PlayerLives : MonoBehaviour
|
|||||||
}
|
}
|
||||||
public void PlayerDied()
|
public void PlayerDied()
|
||||||
{
|
{
|
||||||
if (gameMode == "free-for-all")
|
if (GameManager.gameMode == GameManager.GameMode.freeForAll)
|
||||||
{
|
{
|
||||||
currentLives--;
|
currentLives--;
|
||||||
if (currentLives <= 0)
|
if (currentLives <= 0)
|
||||||
|
|||||||
Reference in New Issue
Block a user