fix: player can enter room multiple times
This commit is contained in:
parent
ee6c2fa97c
commit
2670a870be
@ -63,6 +63,11 @@ private void Awake()
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void Start()
|
private void Start()
|
||||||
|
{
|
||||||
|
InitializeHomePage();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void InitializeHomePage()
|
||||||
{
|
{
|
||||||
HomeConnection.SetActive(true);
|
HomeConnection.SetActive(true);
|
||||||
WaitingRoom.SetActive(false);
|
WaitingRoom.SetActive(false);
|
||||||
@ -72,10 +77,10 @@ private void Start()
|
|||||||
WaitingOtherPlayers.SetActive(false);
|
WaitingOtherPlayers.SetActive(false);
|
||||||
EndGame.SetActive(false);
|
EndGame.SetActive(false);
|
||||||
submitStartGame.SetActive(false);
|
submitStartGame.SetActive(false);
|
||||||
|
submitNewPlayer.interactable = true;
|
||||||
|
|
||||||
if (PlayerPrefs.HasKey("lastplayername"))
|
if (PlayerPrefs.HasKey("lastplayername"))
|
||||||
playerNameField.text = PlayerPrefs.GetString("lastplayername");
|
playerNameField.text = PlayerPrefs.GetString("lastplayername");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnApplicationQuit()
|
private void OnApplicationQuit()
|
||||||
@ -339,13 +344,7 @@ private void OnNewGameState()
|
|||||||
{
|
{
|
||||||
case (int)GameState.EnteringName:
|
case (int)GameState.EnteringName:
|
||||||
{
|
{
|
||||||
WaitingOtherPlayers.SetActive(false);
|
InitializeHomePage();
|
||||||
BeforeStart.SetActive(false);
|
|
||||||
TakePicture.SetActive(false);
|
|
||||||
VotePicture.SetActive(false);
|
|
||||||
EndGame.SetActive(false);
|
|
||||||
|
|
||||||
HomeConnection.SetActive(true);
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case (int)GameState.Explanation:
|
case (int)GameState.Explanation:
|
||||||
@ -477,6 +476,7 @@ public void OnClickSubmitSignIn()
|
|||||||
{
|
{
|
||||||
string playerName = playerNameField.text;
|
string playerName = playerNameField.text;
|
||||||
string roomCode = roomCodeField.text;
|
string roomCode = roomCodeField.text;
|
||||||
|
submitNewPlayer.interactable = false;
|
||||||
PlayerValidateNameAndServerRoom(playerName, roomCode);
|
PlayerValidateNameAndServerRoom(playerName, roomCode);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user