public void FindGame(Button currentButton) { blockPanel.SetActive(true); currentButton.onClick.RemoveAllListeners(); currentButton.onClick.AddListener(() => { lobbyManager.btn_LeftRoom(); }); Color mainColor = new Color32(255, 172, 11, 255); currentButton.image.color = Color.cyan; currentButton.GetComponentInChildren <TextMeshProUGUI>().text = "Connecting..."; currentButton.GetComponentInChildren <TranslationText>().SetText(); actions = new MatchActions() { onJoinedRoom = () => { currentButton.image.color = new Color32(11, 169, 255, 255); currentButton.GetComponentInChildren <TextMeshProUGUI>().text = "Finding Rrivals..."; currentButton.GetComponentInChildren <TranslationText>().SetText(); }, onLeftRoom = () => { currentButton.image.color = mainColor; currentButton.GetComponentInChildren <TextMeshProUGUI>().text = "Find Game"; currentButton.GetComponentInChildren <TranslationText>().SetText(); currentButton.onClick.RemoveAllListeners(); currentButton.onClick.AddListener(() => { FindGame(currentButton); }); blockPanel.SetActive(false); } }; lobbyManager.btn_ConnectToLobbyRanked(actions, betValue); }
public void btn_ConnectToLobbyRanked(MatchActions matchActions, int bet) { rankedLobby = new TypedLobby("RankedGame_" + bet, LobbyType.Default); actions = matchActions; lobby = rankedLobby; ConnectToMaster(); }