Esempio n. 1
0
        public void createCharacterRequest(GameObject characterNameField)
        {
            Text   characterNameText = characterNameField.GetComponent <Text>();
            string characterName     = characterNameText.text;

            if (string.IsNullOrWhiteSpace(characterName))
            {
                messageBoxHandler.alert("이름을 입력해주세요.");
                return;
            }
            else if (characterName.Length < 1 || characterName.Length > 10)
            {
                messageBoxHandler.alert("올바르지 않은 이름입니다.");
                return;
            }

            string warningStr = string.Format("[{0}]로 캐릭터 이름을 정하시겠습니까?", characterName);

            messageBoxHandler.confirm(warningStr, () => {
                var packet           = new CreateCharacterRequestPacket();
                packet.accessKey     = AccountData.Instance.accessKey;
                packet.classType     = this.selectedType;
                packet.characterName = characterName;
                networkManager.sendPacket(packet);
                messageBoxHandler.notice("캐릭터를 생성하고 있습니다.");
            });
        }
Esempio n. 2
0
        public void LoadCharacterSelectionScene()
        {
            messageBoxHandler.confirm("캐릭터 선택 화면으로 돌아가시겠습니까?", () => {
                var scene = SceneManager.GetActiveScene();
                if (scene.name == "Main")
                {
                    var connectedChannelObj = GameObject.Find("Channel Manager/Connected Channel");
                    var connectedChannel    = connectedChannelObj.GetComponent <NetworkManager>();
                    var packet       = new DisconnectChannelRequestPacket();
                    packet.accessKey = AccountData.Instance.accessKey;
                    packet.playerId  = AccountData.Instance.PlayerId;
                    connectedChannel.sendPacket(packet);

                    List <string> excludeObjNames = new List <string>();
                    excludeObjNames.Add("Channel Manager");
                    excludeObjNames.Add("MessageBox Handler");
                    ObjectManager.Instance.DestroyAllObjects(excludeObjNames);
                }

                SceneManager.LoadScene("Select");
            });
        }
Esempio n. 3
0
        private void Start()
        {
            var messageBoxHandlerObj = GameObject.Find("MessageBox Handler");

            messageBoxHandler = messageBoxHandlerObj.GetComponent <MessageBoxHandler>();
            if (messageBoxHandler == null)
            {
                throw new Exception("MessageBox Handler not found");
            }

            var button = GetComponent <Button>();

            button.onClick.AddListener(() => messageBoxHandler.confirm("캐릭터를 생성하시겠습니까?",
                                                                       () => SceneManager.LoadScene("Create")));
        }
Esempio n. 4
0
        public void activeRequestReviveWindow()
        {
            if (messageBoxHandler.IsOpened)
            {
                return;
            }

            messageBoxHandler.confirm("부활하시겠습니까?", () => {
                var packet      = new RevivePlayerRequestPacket();
                packet.playerId = AccountData.Instance.PlayerId;
                networkManager.sendPacket(packet);

                messageBoxHandler.notice("요청하고 있습니다.");
            });
        }
Esempio n. 5
0
        public void deleteCharacterRequest()
        {
            if (!selectedCharacterUI.IsSelected)
            {
                return;
            }

            var packet = new DeleteCharacterRequestPacket();

            packet.accessKey   = AccountData.Instance.accessKey;
            packet.characterId = selectedCharacterUI.CharacterId;

            messageBoxHandler.confirm("삭제 하시겠습니까?", () => {
                networkManager.sendPacket(packet);
                messageBoxHandler.notice("처리 중입니다.");
            });
        }