private void HandleServerToClientStartMessage(ServerToClientStartMessage message) { this.gameId = message.gameId; this.frozen = false; this.transform.position = message.playerPosition.ToVector3(); if (finalCountingDownCoroutine != null) { StopCoroutine(finalCountingDownCoroutine); finalCountingDownCoroutine = null; } if (startCountingDownCoroutine != null) { StopCoroutine(startCountingDownCoroutine); startCountingDownCoroutine = null; } startCountingDownCoroutine = StartCountdown(); StartCoroutine(startCountingDownCoroutine); connectingScreen.enabled = false; waitingForPlayersScreen.enabled = false; winScreen.enabled = false; loseScreen.enabled = false; var hidingPlace = HidingPlace.GetRoot(); if (hidingPlace) { hidingPlace.SetHidingPlaceIndex(message.hidingPlace); } }
private void HandleServerToClientHelloMessage(ServerToClientHelloMessage message) { this.id = message.id; this.gameId = message.gameId; this.transform.position = message.playerPosition.ToVector3(); connectingScreen.enabled = false; waitingForPlayersScreen.enabled = true; winScreen.enabled = false; loseScreen.enabled = false; var hidingPlace = HidingPlace.GetRoot(); if (hidingPlace) { hidingPlace.SetHidingPlaceIndex(message.hidingPlace); } status = Status.waitingForPlayers; }