Пример #1
0
        override public void ExitSubState()
        {
            MainMenuState menu = GStateManager.Instance.CurrentState as MainMenuState;

            if (menu != null && !GPlayerMgr.Instance.IsUniversalIdAttached())
            {
                // UniversalID wasn't attached so restore the user's name to its previous value.
                menu.RestoreName();
            }
            base.ExitSubState();
        }
Пример #2
0
        private void populateGlobalChatWithExistingMessages()
        {
            Transform     contentTransform = GameObject.Find("globalChatContent").transform;
            MainMenuState mainMenu         = GStateManager.Instance.CurrentState as MainMenuState;

            if (mainMenu != null && contentTransform != null)
            {
                ChatCell cell;
                for (int i = 0; i < contentTransform.childCount; ++i)
                {
                    cell = contentTransform.GetChild(i).GetComponent <ChatCell>();
                    mainMenu.AddGlobalChatMessage(cell.RawJson, true);
                }
            }
        }
        protected override void OnDestroy()
        {
            GEventManager.StopListening(GFriendsManager.ON_FRIENDS_LIST_UPDATED, OnRefreshFriendsList);
            GEventManager.StopListening(GBomberRTTConfigManager.ON_SEARCH_RESULTS_UPDATED, OnRefreshSearchResults);

            // TODO: refactor thise presence callback ONLY in the FriendsMgr, and these two other places listen for updates!
            MainMenuState mainMenu = GStateManager.Instance.CurrentState as MainMenuState;

            if (mainMenu)
            {
                GCore.Wrapper.RTTService.RegisterRTTPresenceCallback(mainMenu.OnPresenceCallback);
            }

            base.OnDestroy();
        }