fix error on merge

This commit is contained in:
Marine 2024-01-27 18:10:17 +01:00
parent 530cca0be2
commit 695524eb06
2 changed files with 9 additions and 10 deletions

View File

@ -15,7 +15,7 @@ public class GameManager : MonoBehaviour
{ {
private GameState currentState; private GameState currentState;
private List<Player> players = new List<Player>(); private List<Player> players = new List<Player>();
private Player currentPlayer= new Player(); private Player currentPlayer= null;
@ -158,8 +158,7 @@ private void CheckIfRoomExists(string _roomCode, Action<Room> callback_Room)
/// </summary> /// </summary>
private void JoinRoom(Action callback_OnRoomJoined) private void JoinRoom(Action callback_OnRoomJoined)
{ {
//TODO marine : uncomment aftter merge
/*
string JSON = JsonUtility.ToJson(currentPlayer); string JSON = JsonUtility.ToJson(currentPlayer);
myOnlineRoom.Child("players").Child(currentPlayer.id).SetRawJsonValueAsync(JSON).ContinueWithOnMainThread(task => myOnlineRoom.Child("players").Child(currentPlayer.id).SetRawJsonValueAsync(JSON).ContinueWithOnMainThread(task =>
{ {
@ -173,7 +172,7 @@ private void JoinRoom(Action callback_OnRoomJoined)
callback_OnRoomJoined?.Invoke(); callback_OnRoomJoined?.Invoke();
} }
}); });
*/
} }
/// <summary> /// <summary>
@ -267,19 +266,19 @@ private void OnRoomUpdate(object sender, ChildChangedEventArgs e)
submitStartGame.SetActive(true); submitStartGame.SetActive(true);
} }
Player player2 = new Player(); Player player2 = new Player("3J");
player2.SetName("3J"); player2.SetName("3J");
player2.id = "2"; player2.id = "2";
Player player3 = new Player(); Player player3 = new Player("3J");
player3.SetName("3J"); player3.SetName("3J");
player3.id = "3"; player3.id = "3";
Player player4 = new Player(); Player player4 = new Player("3J");
player4.SetName("3J"); player4.SetName("3J");
player4.id = "4"; player4.id = "4";
Player player5 = new Player(); Player player5 = new Player("3J");
player5.SetName("3J"); player5.SetName("3J");
player5.id = "5"; player5.id = "5";
Player player6 = new Player(); Player player6 = new Player("3J");
player6.SetName("3J"); player6.SetName("3J");
player6.id = "6"; player6.id = "6";

View File

@ -227,7 +227,7 @@ public void PlayerConnect(object sender, ChildChangedEventArgs args)
[ContextMenu("Fake Player Connection")] [ContextMenu("Fake Player Connection")]
private void FakePlayerConnection() private void FakePlayerConnection()
{ {
Player temp = new Player(); Player temp = new Player("Momo");
temp.id = System.Guid.NewGuid().ToString(); temp.id = System.Guid.NewGuid().ToString();
temp.SetName("Momo"); temp.SetName("Momo");
} }