localization - closes #17 & #16 #19

Merged
Fangh merged 13 commits from localization into main 2024-02-29 21:50:50 +00:00
Showing only changes of commit d9580450cc - Show all commits

View File

@ -282,17 +282,9 @@ private void JoinRoom(Action callback_OnRoomJoined)
public void StartGame() public void StartGame()
{ {
// send Start Game // send Start Game
string JSON = JsonUtility.ToJson(myRoom);
Debug.Log(JSON);
try try
{ {
SendCurrentState(GameState.Explanation, () => SendCurrentState(GameState.Explanation);
{
Debug.Log($"start the game", this);
WaitingRoom.SetActive(false);
BeforeStart.SetActive(true);
});
} }
catch (Exception ex) catch (Exception ex)
{ {
@ -473,7 +465,8 @@ private bool CheckIfIAmTheFirst(List<Player> players)
} }
return isFirst; return isFirst;
} }
public void SendCurrentState(GameState state, Action callback_oncCurrentStateSent)
public void SendCurrentState(GameState state, Action callback_onCurrentStateSent = null)
{ {
myOnlineRoom.Child("currentState").SetValueAsync((int)state).ContinueWithOnMainThread(task => myOnlineRoom.Child("currentState").SetValueAsync((int)state).ContinueWithOnMainThread(task =>
{ {
@ -483,10 +476,9 @@ public void SendCurrentState(GameState state, Action callback_oncCurrentStateSen
} }
else else
{ {
callback_oncCurrentStateSent?.Invoke(); callback_onCurrentStateSent?.Invoke();
} }
}); ; });
} }
public void OnClickSubmitSignIn() public void OnClickSubmitSignIn()