private IEnumerator EnterPrivateRoom(string roomName) { if (!PhotonNetwork.InLobby) { connectingPanel.gameObject.SetActive(true); while (!PhotonNetwork.InLobby) { yield return(null); } connectingPanel.gameObject.SetActive(false); } var isSuccess = PhotonNetwork.JoinRoom(roomName); if (isSuccess) { waitPanel.gameObject.SetActive(true); } else { if (_messagePanel == null) { _messagePanel = Instantiate(messagePanel, this.gameObject.transform); _messagePanel.Initialized("Failed to enter room", null); } } }
private IEnumerator EnterRoom(string roomName, RoomOptions option) { if (!PhotonNetwork.InLobby) { connectingPanel.gameObject.SetActive(true); while (!PhotonNetwork.InLobby) { yield return(null); } connectingPanel.gameObject.SetActive(false); } var isSuccess = PhotonNetwork.CreateRoom(roomName, option); if (!isSuccess) { if (_messagePanel == null) { _messagePanel = Instantiate(messagePanel, this.gameObject.transform); _messagePanel.Initialized("Failed to create room. \n Try a different room name", null); } } else { waitPanel.gameObject.SetActive(true); } }
private void SetCautionNumber(GameObject deployer) { if (_messagePanel == null) { _messagePanel = Instantiate(messagePanel, deployer.transform); _messagePanel.Initialized("Number : Minimum 1 Maximum 2147483647", null); } }
private void SetCautionName(GameObject deployer) { if (_messagePanel == null) { _messagePanel = Instantiate(messagePanel, deployer.transform); _messagePanel.Initialized("Please enter between 1 and 7 characters", null); } }
public void OnEndEdit() { var correctText = inputValidation.CheckInputString(roomNameField.text, this.gameObject); if (string.IsNullOrEmpty(correctText)) { return; } if (!IsEnabelCreate()) { if (_messagePanel == null) { _messagePanel = Instantiate(messagePanel, this.gameObject.transform); _messagePanel.Initialized("PlayerCount And NpcCount → Number : Up to 20 in total \n Other → Number: Minimum 1 Maximum 2000000000", null); return; } } CreateNewRoom(correctText); }
public void OnPlayerCountValueChanged() { var count = inputValidation.CheckInputNumber(playerCountField.text, this.gameObject); if (MaxPlayerCount < count + npcCount.Value) { playerCountField.enabled = false; count = MaxPlayerCount - npcCount.Value; playerCount.Value = (byte)(count); if (_messagePanel == null) { _messagePanel = Instantiate(messagePanel, this.gameObject.transform); _messagePanel.Initialized("Number : Up to 16 in total", () => { playerCountField.enabled = true; }); } } else { playerCount.Value = (byte)(count); } }