From 3298be65699984c6d479ab5c7a3fadd2b35c0cdd Mon Sep 17 00:00:00 2001 From: Claire Peta Date: Thu, 12 Sep 2019 14:04:37 +1000 Subject: [PATCH] Fix the spawning getting the right pen at the start of the game --- Assets/Data/Map Generation/Map Manager.asset | 4 ++-- .../GameMode Scenes/RacetrackGameMode.unity | 4 ++-- .../GameMode/ColorGameMode/RacetrackGameMode.cs | 3 +-- .../Scripts/GameMode/ColorGameMode/RoundsLeft.cs | 2 +- Assets/Scripts/Map Generation/MapManager.cs | 15 ++++++--------- Assets/Scripts/Map Generation/MapManager.cs.meta | 5 ++++- 6 files changed, 16 insertions(+), 17 deletions(-) diff --git a/Assets/Data/Map Generation/Map Manager.asset b/Assets/Data/Map Generation/Map Manager.asset index 85f047c..2c91a12 100644 --- a/Assets/Data/Map Generation/Map Manager.asset +++ b/Assets/Data/Map Generation/Map Manager.asset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:b6b048d7cd1d636b7d5c6eb9ab640eeec39d921f03df1ea868af25f2c72ae5f9 -size 901 +oid sha256:622bffe7b746c4cdf6ed74274b6b09dc3ec7066d4fc03abb09ab0d1e544ce394 +size 1089 diff --git a/Assets/Scenes/GameMode Scenes/RacetrackGameMode.unity b/Assets/Scenes/GameMode Scenes/RacetrackGameMode.unity index 276b665..0cf88c1 100644 --- a/Assets/Scenes/GameMode Scenes/RacetrackGameMode.unity +++ b/Assets/Scenes/GameMode Scenes/RacetrackGameMode.unity @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:39df638172c07d5d3aaf8f76028a3f49445d7a18bb3e18d8956797a2587d6e63 -size 25929 +oid sha256:6f72ca2d694b49cd62ecf0fc314aa95d9e4f6a5aac8dcff71b4d2544334a7396 +size 7092 diff --git a/Assets/Scripts/GameMode/ColorGameMode/RacetrackGameMode.cs b/Assets/Scripts/GameMode/ColorGameMode/RacetrackGameMode.cs index e4ef42a..18ef1d7 100644 --- a/Assets/Scripts/GameMode/ColorGameMode/RacetrackGameMode.cs +++ b/Assets/Scripts/GameMode/ColorGameMode/RacetrackGameMode.cs @@ -26,8 +26,7 @@ public class RacetrackGameMode : GameMode /// protected override void OnPreGameStart() { - //mapManager.init(ConnectedClients.Count); - mapManager.init(5); + mapManager.init(); } /// diff --git a/Assets/Scripts/GameMode/ColorGameMode/RoundsLeft.cs b/Assets/Scripts/GameMode/ColorGameMode/RoundsLeft.cs index 72e0d0e..aeead3e 100644 --- a/Assets/Scripts/GameMode/ColorGameMode/RoundsLeft.cs +++ b/Assets/Scripts/GameMode/ColorGameMode/RoundsLeft.cs @@ -33,7 +33,7 @@ public class RoundsLeft : MonoBehaviour [ContextMenu("Do Animation")] public void StartAnimation() { - UpdateText(); + //UpdateText(); Vector3 startPosition = new Vector3(Screen.width * 2, 0, 0); diff --git a/Assets/Scripts/Map Generation/MapManager.cs b/Assets/Scripts/Map Generation/MapManager.cs index 7c8c455..d9a626a 100644 --- a/Assets/Scripts/Map Generation/MapManager.cs +++ b/Assets/Scripts/Map Generation/MapManager.cs @@ -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(); if (players < 5) diff --git a/Assets/Scripts/Map Generation/MapManager.cs.meta b/Assets/Scripts/Map Generation/MapManager.cs.meta index b0c2eb8..6b3fc71 100644 --- a/Assets/Scripts/Map Generation/MapManager.cs.meta +++ b/Assets/Scripts/Map Generation/MapManager.cs.meta @@ -3,7 +3,10 @@ guid: 410315ba4dbcba04a90c22b64b070d6a MonoImporter: externalObjects: {} serializedVersion: 2 - defaultReferences: [] + defaultReferences: + - clients: {fileID: 11400000, guid: 78d89605739516c4f9c66fb270137102, type: 2} + - spawn4: {instanceID: 0} + - spawn8: {instanceID: 0} executionOrder: 0 icon: {instanceID: 0} userData: