示例#1
0
        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);
                }
            }
        }
示例#2
0
        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);
            }
        }
示例#3
0
 private void SetCautionNumber(GameObject deployer)
 {
     if (_messagePanel == null)
     {
         _messagePanel = Instantiate(messagePanel, deployer.transform);
         _messagePanel.Initialized("Number : Minimum 1 Maximum 2147483647", null);
     }
 }
示例#4
0
 private void SetCautionName(GameObject deployer)
 {
     if (_messagePanel == null)
     {
         _messagePanel = Instantiate(messagePanel, deployer.transform);
         _messagePanel.Initialized("Please enter between 1 and 7 characters", null);
     }
 }
示例#5
0
        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);
        }
示例#6
0
        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);
            }
        }