private void OnLobbySessionSlotSelected(LobbySessionSlot lobbySessionSlot) { statusLabel.SetString(connectionStartString); UpdateInputState(false); var clientConnectionToken = new ClientConnectionToken { PrefferedClass = (ClassType)PlayerPrefs.GetInt(UnitUtils.PreferredClassPrefName, 0), Name = playerNameInput.text }; photonReference.StartConnection(lobbySessionSlot.UdpSession, clientConnectionToken, OnConnectSuccess, OnConnectFail); void OnConnectFail(ClientConnectFailReason failReason) { statusLabel.SetString(LocalizationReference.Localize(failReason)); UpdateInputState(true); } void OnConnectSuccess() { statusLabel.SetString(connectSuccessString); UpdateInputState(true); WindowController.HidePanel <LobbyPanel>(); } }
private void OnSinglePlayerButtonClicked() { statusLabel.SetString(serverStartString); UpdateInputState(false); photonReference.StartSinglePlayer(new ServerRoomToken(serverNameInput.text, playerNameInput.text, selectedMapSlot.MapDefinition.MapName), OnServerStartSuccess, OnServerStartFail); void OnServerStartFail() { statusLabel.SetString(serverStartFailedString); UpdateInputState(true); } void OnServerStartSuccess() { statusLabel.SetString(serverStartSuccessString); UpdateInputState(true); WindowController.HidePanel <LobbyPanel>(); } }
private void OnLobbySessionSlotSelected(LobbySessionSlot lobbySessionSlot) { statusLabel.SetString(connectionStartString); UpdateInputState(false); photonReference.StartConnection(lobbySessionSlot.UdpSession, new ClientConnectionToken(playerNameInput.text), OnConnectSuccess, OnConnectFail); void OnConnectFail(ClientConnectFailReason failReason) { statusLabel.SetString(LocalizationReference.Localize(failReason)); UpdateInputState(true); } void OnConnectSuccess() { statusLabel.SetString(connectSuccessString); UpdateInputState(true); WindowController.HidePanel <LobbyPanel>(); } }