Beispiel #1
0
        private IEnumerator CloseMatchLobby()
        {
            UpdateGameStatus(Constants.MATCH_LOBBY_CLOSING);
            IsLobbyCreated = false;

            if (ApplicationModel.CurrentMatchLobby != null)
            {
                yield return(StartCoroutine(DeleteMatchLobby(ApplicationModel.CurrentMatchLobby.matchLobbyId)));

                var sharedGroupHandler = new SharedGroupHandler(ApplicationModel.CurrentPlayer);
                yield return(sharedGroupHandler.Delete(ApplicationModel.CurrentSharedGroupData.sharedGroupId));
            }

            ApplicationModel.CurrentMatchLobby = null;
            ApplicationModel.ConnectedToLobby  = false;
            MatchLobbyText.text = string.Empty;
            QuickMatchBtn.gameObject.SetActive(true);
            MatchLobbyNameInput.gameObject.SetActive(true);
            SearchMatchLobbyBtn.gameObject.SetActive(true);
            ManageMatchLobbyBtn.GetComponentInChildren <Text>().text = Constants.BTN_CREATE_MATCH_LOBBY;
        }
Beispiel #2
0
        void Start()
        {
            // TODO: When the appropriate place has been developed move this login process there
            if (ApplicationModel.CurrentPlayer == null)
            {
                var loginHandler = new LoginHandler();
                loginHandler.Login(OnPlayerLogin, OnLoginFail);
            }

            if (!string.IsNullOrWhiteSpace(ApplicationModel.CurrentSharedGroupData?.sharedGroupId))
            {
                var sharedGroupHandler = new SharedGroupHandler(ApplicationModel.CurrentPlayer);
                StartCoroutine(sharedGroupHandler.Delete(ApplicationModel.CurrentSharedGroupData.sharedGroupId));
            }

            ApplicationModel.Reset();
            LookingForMatch = false;
            ManageMatchLobbyBtn.onClick.AddListener(ManageMatchLobbyBtnOnClick);
            ExitBtn.onClick.AddListener(OnClickExitBtn);
            QuickMatchBtn.onClick.AddListener(OnClickQuickMatch);
            SearchMatchLobbyBtn.onClick.AddListener(OnMatchLobbySearchClick);
        }