s3607057 (Angus Niven) 5 years ago
parent
commit
f5295378f4
2 changed files with 9 additions and 20 deletions
  1. +7
    -2
      Assets/Scripts/Managers/GameManager.cs
  2. +2
    -18
      Assets/Scripts/UI/Client/LoginUIManager.cs

+ 7
- 2
Assets/Scripts/Managers/GameManager.cs View File

@ -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());

+ 2
- 18
Assets/Scripts/UI/Client/LoginUIManager.cs View File

@ -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;

Loading…
Cancel
Save