|
|
@ -96,8 +96,8 @@ public class GameManager : MonoBehaviour |
|
|
|
{ |
|
|
|
gamemode.RoundStart(playerArray.ToArray()); |
|
|
|
LogicProtocols.FloatMsg RoundTime = new LogicProtocols.FloatMsg( gamemode.GetRoundTime()); |
|
|
|
bspawn.getPlayerScores(); |
|
|
|
bspawn.getPlayerLocations(); |
|
|
|
//bspawn.getPlayerScores();
|
|
|
|
//bspawn.getPlayerLocations();
|
|
|
|
playerArray.ForEach(p => p.client.conn.Send(LogicProtocols.SendRoundTime, RoundTime)); |
|
|
|
} |
|
|
|
|
|
|
@ -105,33 +105,6 @@ public class GameManager : MonoBehaviour |
|
|
|
{ |
|
|
|
playerArray.ForEach(p => p.recievedList = false); |
|
|
|
|
|
|
|
//while (playerArray.Any(p => !p.blockReader.Finished))
|
|
|
|
//{
|
|
|
|
// foreach (PlayerData player in playerArray)
|
|
|
|
// {
|
|
|
|
// if (!player.waiting)
|
|
|
|
// {
|
|
|
|
// if (player.blockReader.CurrentBlock != null && !player.blockReader.CurrentBlock.hasBeenRemoved)
|
|
|
|
// {
|
|
|
|
// //Debug.Log("used Block: " + player.blockReader.CurrentBlock.name);
|
|
|
|
// player.client.Inventory.Remove(player.blockReader.CurrentBlock);
|
|
|
|
// player.blockReader.CurrentBlock.hasBeenRemoved = true;
|
|
|
|
// }
|
|
|
|
// player.waiting = player.blockReader.Read(player.character, AnimationTime);
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
//
|
|
|
|
// yield return new WaitForSeconds(AnimationTime);
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
// if (playerArray.All(p => p.waiting))
|
|
|
|
// {
|
|
|
|
// playerArray.ForEach(p => p.waiting = false);
|
|
|
|
// Debug.Log("Finished one move");
|
|
|
|
// }
|
|
|
|
//}
|
|
|
|
|
|
|
|
Debug.Log("Doing Round Routine"); |
|
|
|
|
|
|
|
while (playerArray.Any(p => !p.blockReader.Finished)) |
|
|
@ -144,6 +117,8 @@ public class GameManager : MonoBehaviour |
|
|
|
yield return new WaitUntil(() => playerArray.All(p => p.waiting)); |
|
|
|
|
|
|
|
gamemode.FinishedMove(playerArray.ToArray()); |
|
|
|
playerArray.ForEach(p => p.client.SendScore()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (gamemode.isGameOver(playerArray.ToArray())) |
|
|
@ -208,6 +183,7 @@ public class GameManager : MonoBehaviour |
|
|
|
|
|
|
|
Debug.Log("Waiting: " + waitTime); |
|
|
|
yield return new WaitForSeconds(waitTime); |
|
|
|
gamemode.OnePlayerMoved(data); |
|
|
|
} |
|
|
|
data.waiting = true; |
|
|
|
} |
|
|
|