// Button handlers public void OnStartGame() { SoundManager.Play(SingletonSOSounds.Instance.Click01); // Return if no network address is specified if (string.IsNullOrEmpty(serverAddressInput.text)) { return; } // Set and cache player name PlayerPrefs.SetString(UserNamePlayerPref, PlayerManager.CurrentCharacterSettings.Name); // Start game dialogueTitle.text = "Starting Game..."; if (!hostServerToggle.isOn) { ConnectToServer(); } else { LoadingScreenManager.LoadFromLobby(CustomNetworkManager.Instance.StartHost); } // Hide dialogue and show status text gameObject.SetActive(false); // UIManager.Chat.CurrentChannelText.text = "<color=green>Loading game please wait..</color>\r\n"; }
// Game handlers public void ConnectToServer() { LoadingScreenManager.LoadFromLobby(DoServerConnect); }