|
|
@ -1,4 +1,6 @@ |
|
|
|
using System.Collections; |
|
|
|
using Networking.Client; |
|
|
|
using Networking.Server; |
|
|
|
using System.Collections; |
|
|
|
using System.Collections.Generic; |
|
|
|
using UnityEngine; |
|
|
|
|
|
|
@ -6,6 +8,7 @@ using UnityEngine; |
|
|
|
[CreateAssetMenu(menuName = "Major Project/Map Manager")] |
|
|
|
public class MapManager : ScriptableObject |
|
|
|
{ |
|
|
|
public ClientList clients; |
|
|
|
public GameObject spawn4; //The section to use as a spawn-point for games with 2-5 players
|
|
|
|
public GameObject spawn8; //The section to use a spawn-point for games with 5-8 players
|
|
|
|
//In 5-player games, we choose between them at random
|
|
|
@ -20,15 +23,9 @@ public class MapManager : ScriptableObject |
|
|
|
float startX = -16.0f; //The x-position of the current start of the track
|
|
|
|
float endX = -16.0f; //The x-position of the current end of the track
|
|
|
|
|
|
|
|
|
|
|
|
// Start is called before the first frame update
|
|
|
|
void Start() |
|
|
|
{ |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
public void init(int players) |
|
|
|
public void init() |
|
|
|
{ |
|
|
|
int players = clients.ConnectedClients.Count; |
|
|
|
activeSections = new List<MapSection>(); |
|
|
|
|
|
|
|
if (players < 5) |
|
|
|