From 094ec36394a289c6dbee5202d7b8e5314aeb1a08 Mon Sep 17 00:00:00 2001 From: Claire Peta Date: Mon, 5 Aug 2019 15:49:49 +1000 Subject: [PATCH] Meeting fixes for running once --- Assets/Scripts/Managers/GameManager.cs | 9 +++++++-- Assets/Scripts/UI/Client/LoginUIManager.cs | 20 ++------------------ 2 files changed, 9 insertions(+), 20 deletions(-) diff --git a/Assets/Scripts/Managers/GameManager.cs b/Assets/Scripts/Managers/GameManager.cs index 8aa546b..ee215ab 100644 --- a/Assets/Scripts/Managers/GameManager.cs +++ b/Assets/Scripts/Managers/GameManager.cs @@ -110,10 +110,15 @@ public class GameManager : MonoBehaviour { //Debug.Log("One Move"); foreach (PlayerData player in playerArray) - RunOnce(player); + { + Debug.Log(player.client.Name); + StartCoroutine(RunOnce(player)); + yield return new WaitUntil(() => player.waiting); + } + //wait until all players have finished - yield return new WaitUntil(() => playerArray.All(p => p.waiting)); + //yield return new WaitUntil(() => playerArray.All(p => p.waiting)); gamemode.FinishedMove(playerArray.ToArray()); playerArray.ForEach(p => p.client.SendScore()); diff --git a/Assets/Scripts/UI/Client/LoginUIManager.cs b/Assets/Scripts/UI/Client/LoginUIManager.cs index e8e61ee..16f8701 100644 --- a/Assets/Scripts/UI/Client/LoginUIManager.cs +++ b/Assets/Scripts/UI/Client/LoginUIManager.cs @@ -41,8 +41,8 @@ public class LoginUIManager : MonoBehaviour private string playerAnimal; private Color playerColor; - bool animalSelected = true; - bool colorSelected = true; + bool animalSelected = false; + bool colorSelected = false; #region Unity Functions @@ -130,22 +130,6 @@ public class LoginUIManager : MonoBehaviour } } - public void OnClick_Color(Color playerColor) - { - this.playerColor = playerColor; - } - - public void OnClick_Colour(string hex) - { - Color newColor = new Color(); - if (ColorUtility.TryParseHtmlString(hex, out newColor)){ - this.playerColor = newColor; - colorSelected = true; - } - - clientManager.SendPlayerCDetails(playerColor); - } - public void OnClick_Animal(string playerAnimal) { this.playerAnimal = playerAnimal;