From 695524eb0653eb407f49df2cdd8a603ac976f5b4 Mon Sep 17 00:00:00 2001 From: Marine Date: Sat, 27 Jan 2024 18:10:17 +0100 Subject: [PATCH] fix error on merge --- Assets/Scripts/GameManager.cs | 17 ++++++++--------- Assets/Scripts/RoomManager.cs | 2 +- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/Assets/Scripts/GameManager.cs b/Assets/Scripts/GameManager.cs index 9ea9973..5f912ce 100644 --- a/Assets/Scripts/GameManager.cs +++ b/Assets/Scripts/GameManager.cs @@ -15,7 +15,7 @@ public class GameManager : MonoBehaviour { private GameState currentState; private List players = new List(); - private Player currentPlayer= new Player(); + private Player currentPlayer= null; @@ -158,8 +158,7 @@ private void CheckIfRoomExists(string _roomCode, Action callback_Room) /// private void JoinRoom(Action callback_OnRoomJoined) { - //TODO marine : uncomment aftter merge - /* + string JSON = JsonUtility.ToJson(currentPlayer); myOnlineRoom.Child("players").Child(currentPlayer.id).SetRawJsonValueAsync(JSON).ContinueWithOnMainThread(task => { @@ -173,7 +172,7 @@ private void JoinRoom(Action callback_OnRoomJoined) callback_OnRoomJoined?.Invoke(); } }); - */ + } /// @@ -267,19 +266,19 @@ private void OnRoomUpdate(object sender, ChildChangedEventArgs e) submitStartGame.SetActive(true); } - Player player2 = new Player(); + Player player2 = new Player("3J"); player2.SetName("3J"); player2.id = "2"; - Player player3 = new Player(); + Player player3 = new Player("3J"); player3.SetName("3J"); player3.id = "3"; - Player player4 = new Player(); + Player player4 = new Player("3J"); player4.SetName("3J"); player4.id = "4"; - Player player5 = new Player(); + Player player5 = new Player("3J"); player5.SetName("3J"); player5.id = "5"; - Player player6 = new Player(); + Player player6 = new Player("3J"); player6.SetName("3J"); player6.id = "6"; diff --git a/Assets/Scripts/RoomManager.cs b/Assets/Scripts/RoomManager.cs index 614a71b..acaafd8 100644 --- a/Assets/Scripts/RoomManager.cs +++ b/Assets/Scripts/RoomManager.cs @@ -227,7 +227,7 @@ public void PlayerConnect(object sender, ChildChangedEventArgs args) [ContextMenu("Fake Player Connection")] private void FakePlayerConnection() { - Player temp = new Player(); + Player temp = new Player("Momo"); temp.id = System.Guid.NewGuid().ToString(); temp.SetName("Momo"); }