示例#1
0
        private void Start()
        {
            var connectedChannel = GameObject.Find("Channel Manager/Connected Channel");

            networkManager = connectedChannel?.GetComponent <NetworkManager>();
            if (networkManager == null)
            {
                throw new Exception("Connected channel not found");
            }

            var msgBoxHandlerObj = GameObject.Find("MessageBox Handler");

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

            networkManager.registerNotification(PacketType.GainMonsterExp, gainMonsterExp);
            networkManager.registerNotification(PacketType.NotifyLevelUpPlayer, notifyLevelUpPlayer);
            networkManager.registerNotification(PacketType.NotifyTakeDamagePlayer, notifyTakeDamagePlayer);
            networkManager.registerNotification(PacketType.NotifyPlayerRevive, notifyPlayerRevive);
            networkManager.registerNotification(PacketType.NotifyPlayerDead, notifyPlayerDead);
            networkManager.registerNotification(PacketType.NotifyConnectPlayer, notifyConnectPlayer);
            networkManager.registerNotification(PacketType.NotifyDisconnectPlayer, notifyDisconnectPlayer);
            networkManager.registerNotification(PacketType.NotifyPlayerMovement, notifyPlayerMovement);
            networkManager.registerNotification(PacketType.NotifyPlayerAction, notifyPlayerAction);
            networkManager.registerNotification(PacketType.RevivePlayerResponse, revivePlayerResponse);

            this.gameObject.SetActive(false);
        }
示例#2
0
        private void Start()
        {
            var connectedChannel = GameObject.Find("Channel Manager/Connected Channel");

            networkManager = connectedChannel?.GetComponent <NetworkManager>();
            if (networkManager == null)
            {
                throw new Exception("Connected Channel not found");
            }

            var msgBoxHandlerObj = GameObject.Find("MessageBox Handler");

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

            networkManager.registerNotification(PacketType.SearchAccountResponse, searchAccountResponse);
            networkManager.registerNotification(PacketType.CreateAccountResponse, createAccountResponse);
            networkManager.registerNotification(PacketType.GetCharacterListResponse, getCharacterListResponse);
            networkManager.registerNotification(PacketType.ChangeCharacterOrderResponse, changeCharacterOrderResponse);
            networkManager.registerNotification(PacketType.DeleteCharacterResponse, deleteCharacterResponse);

            this.searchAccountRequest();
        }
示例#3
0
        private void Start()
        {
            var messageBoxHandlerObj = GameObject.Find("MessageBox Handler");

            messageBoxHandler = messageBoxHandlerObj?.GetComponent <MessageBoxHandler>();
            if (messageBoxHandler == null)
            {
                throw new Exception("Message Box Handler not found");
            }
        }
        private void Start()
        {
            var msgHandlerObject = GameObject.Find("MessageBox Handler");

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

            userIdField.ActivateInputField();
        }
示例#5
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")));
        }
示例#6
0
        private void Start()
        {
            var connectedChannel = GameObject.Find("Channel Manager/Connected Channel");

            networkManager = connectedChannel?.GetComponent <NetworkManager>();
            if (networkManager == null)
            {
                throw new Exception("Connected channel not found");
            }

            var messageBoxHandlerObj = GameObject.Find("MessageBox Handler");

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

            networkManager.registerNotification(PacketType.CreateCharacterResponse, createCharacterResponse);
        }
示例#7
0
        private void Start()
        {
            var msgBoxHandlerObj = GameObject.Find("MessageBox Handler");

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

            var channelListUIObj = GameObject.Find("Channel List");

            channelListUI = channelListUIObj?.GetComponent <UIChannelList>();
            if (channelListUI == null)
            {
                throw new Exception("Channel List UI not found");
            }

            networkManager = GetComponent <NetworkManager>();
            networkManager.connectServer();
            networkManager.registerNotification(PacketType.GetChannelListResponse, getChannelListResponse);

            this.getChannelListRequest();
        }