Update GameManager.cs
This commit is contained in:
@@ -3,6 +3,26 @@ using UnityEngine;
|
||||
|
||||
public class GameManager : MonoBehaviour
|
||||
{
|
||||
<<<<<<< Updated upstream
|
||||
=======
|
||||
|
||||
public void StartGame()
|
||||
{
|
||||
if (gameMode == GameMode.freeForAll)
|
||||
{
|
||||
StartFreeForAll();
|
||||
}
|
||||
if (gameMode == GameMode.keepAway)
|
||||
{
|
||||
StartKeepAway();
|
||||
}
|
||||
if (gameMode == GameMode.obstacleCourse)
|
||||
{
|
||||
StartObstacleCourse();
|
||||
}
|
||||
}
|
||||
|
||||
>>>>>>> Stashed changes
|
||||
public enum GameMode
|
||||
{
|
||||
freeForAll,
|
||||
@@ -12,13 +32,13 @@ public class GameManager : MonoBehaviour
|
||||
|
||||
public static GameMode gameMode = GameMode.freeForAll;
|
||||
|
||||
public static string map = "Platformer With Headroom";
|
||||
public static string map = "Platformer With Headroom"; //is called for in playermanager but should probably be removed.
|
||||
|
||||
public static List<GameObject> players = new List<GameObject>();
|
||||
|
||||
public Vector2 spawnPosition;
|
||||
|
||||
private void Start()
|
||||
private void StartFreeForAll()
|
||||
{
|
||||
foreach (GameObject player in players)
|
||||
{
|
||||
@@ -26,6 +46,7 @@ public class GameManager : MonoBehaviour
|
||||
}
|
||||
}
|
||||
|
||||
<<<<<<< Updated upstream
|
||||
public void StartGame()
|
||||
{
|
||||
if (gameMode == GameMode.freeForAll)
|
||||
@@ -33,4 +54,25 @@ public class GameManager : MonoBehaviour
|
||||
// Start free for all game
|
||||
}
|
||||
}
|
||||
=======
|
||||
private void StartKeepAway()
|
||||
{
|
||||
foreach (GameObject player in players)
|
||||
{
|
||||
player.transform.position = spawnPosition;
|
||||
}
|
||||
}
|
||||
private void StartObstacleCourse()
|
||||
{
|
||||
foreach (GameObject player in players)
|
||||
{
|
||||
player.transform.position = spawnPosition;
|
||||
}
|
||||
}
|
||||
|
||||
private void Start()
|
||||
{
|
||||
StartGame();
|
||||
}
|
||||
>>>>>>> Stashed changes
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user