示例#1
0
        void OnSessionStateDataChanged(UISessionStateData data)
        {
            switch (data.sessionState.loggedState)
            {
            case LoginState.LoggedIn:
                m_ProfileButtonImage.enabled = true;
                m_ProfileButtonIcon.enabled  = false;
                m_ProfileButtonText.enabled  = true;
                m_ProfileButtonText.text     = GetInitials(data.sessionState.user.DisplayName);
                m_UserNameText.text          = data.sessionState.user.DisplayName;
                break;

            case LoginState.LoggedOut:
                m_ProfileButtonImage.enabled = false;
                m_ProfileButtonIcon.enabled  = true;
                m_ProfileButtonText.enabled  = false;
                m_ProfileButtonText.text     = String.Empty;
                m_UserNameText.text          = String.Empty;
                break;

            case LoginState.LoggingIn:
            case LoginState.LoggingOut:
                // todo put spinner
                break;
            }
        }
示例#2
0
 void OnSessionStateDataChanged(UISessionStateData data)
 {
     m_DialogButton.interactable = data.sessionState.loggedState == LoginState.LoggedIn;
     if (data.sessionState.loggedState == LoginState.LoggedIn)
     {
         InstantiateButtons(data.sessionState.projects);
     }
 }
        private void OnSessionStateDataChanged(UISessionStateData obj)
        {
            var uid = obj.sessionState.user?.UserId;

            if (obj.sessionState.loggedState == LoginState.LoggedIn && uid != userId)
            {
                TrackViewerLoaded(uid);
                userId = uid;
            }
        }
 void OnSessionStateDataChanged(UISessionStateData sessionData)
 {
     if (m_currentPermission != sessionData.sessionState.linkSharePermission)
     {
         m_currentPermission      = sessionData.sessionState.linkSharePermission;
         m_PublicLinkToggle.on    = m_currentPermission == LinkPermission.Public;
         m_LinkAccessMessage.text = m_currentPermission == LinkPermission.Public ?
                                    "People not added to this project have access with the link." : "Only people added to the project have access with the link.";
     }
 }
示例#5
0
        void OnSessionStateDataChanged(UISessionStateData data)
        {
            switch (data.sessionState.loggedState)
            {
            case LoginState.LoggedIn:
                m_UserNameText.text = data.sessionState.user.DisplayName;
                break;

            case LoginState.LoggedOut:
                m_UserNameText.text = String.Empty;
                break;
            }
        }
示例#6
0
        void OnSessionStateDataChanged(UISessionStateData data)
        {
            if (m_LoginState != data.sessionState.loggedState)
            {
                switch (data.sessionState.loggedState)
                {
                case LoginState.LoggedIn:
                    UIStateManager.current.Dispatcher.Dispatch(
                        Payload <ActionTypes> .From(ActionTypes.OpenDialog, DialogType.LandingScreen));
                    m_WelcomePanel.SetActive(false);
                    m_NoProjectPanel.SetActive(false);
                    m_FetchingProjectsPanel.SetActive(true);
                    m_RefreshButton.gameObject.SetActive(true);
                    break;

                case LoginState.LoggedOut:
                    ClearProjectListItem();
                    UIStateManager.current.Dispatcher.Dispatch(
                        Payload <ActionTypes> .From(ActionTypes.OpenDialog, DialogType.LandingScreen));
                    UIStateManager.current.Dispatcher.Dispatch(Payload <ActionTypes> .From(ActionTypes.CloseProject,
                                                                                           UIStateManager.current.projectStateData.activeProject));
                    m_WelcomePanel.SetActive(true);
                    m_NoProjectPanel.SetActive(false);
                    m_FetchingProjectsPanel.SetActive(false);
                    m_RefreshButton.gameObject.SetActive(false);
                    break;

                case LoginState.LoggingIn:
                case LoginState.LoggingOut:
                    // todo put spinner
                    break;
                }

                m_LoginState = data.sessionState.loggedState;
            }

            if (m_LoginState == LoginState.LoggedIn)
            {
                if (m_Projects != data.sessionState.projects && !EnumerableExtension.SafeSequenceEquals(m_Projects, data.sessionState.projects))
                {
                    InstantiateProjectItems(data.sessionState.projects);
                    m_Projects = data.sessionState.projects;
                }
                else if (UIStateManager.current.stateData.progressData.progressState == ProgressData.ProgressState.NoPendingRequest && data.sessionState.projects.Length == 0)
                {
                    m_NoProjectPanel.SetActive(true);
                    m_FetchingProjectsPanel.SetActive(false);
                }
            }
        }
示例#7
0
        void OnSessionStateChanged(UISessionStateData data)
        {
            if (m_LoginState != data.sessionState.loggedState)
            {
                switch (data.sessionState.loggedState)
                {
                case LoginState.LoggedIn:
                    var matchmakerId = UIStateManager.current.roomConnectionStateData.localUser.matchmakerId;
                    m_CurrentUserId = string.IsNullOrEmpty(matchmakerId)
                            ? data.sessionState.user?.UserId
                            : matchmakerId;
                    break;

                case LoginState.LoggedOut:
                    m_CurrentUserId = String.Empty;
                    break;
                }
                m_LoginState = data.sessionState.loggedState;
            }
        }
示例#8
0
        void OnSessionStateDataChanged(UISessionStateData data)
        {
            if (m_LocalUserIdentity != data.sessionState.userIdentity)
            {
                m_LocalUserIdentity = data.sessionState.userIdentity;
                switch (data.sessionState.loggedState)
                {
                case LoginState.LoggedIn:
                    UpdateUser(m_LocalUserIdentity.matchmakerId, true);
                    break;

                case LoginState.LoggedOut:
                    Clear();
                    break;

                case LoginState.LoggingIn:
                case LoginState.LoggingOut:
                    break;
                }
            }
        }
示例#9
0
        void OnSessionStateDataChanged(UISessionStateData data)
        {
            if (m_LoginState != data.sessionState.loggedState)
            {
                switch (data.sessionState.loggedState)
                {
                case LoginState.LoggedIn:
                    UIStateManager.current.Dispatcher.Dispatch(
                        Payload <ActionTypes> .From(ActionTypes.OpenDialog, DialogType.LandingScreen));
                    m_WelcomePanel.SetActive(false);
                    m_RefreshButton.gameObject.SetActive(true);
                    break;

                case LoginState.LoggedOut:
                    ClearProjectListItem();
                    UIStateManager.current.Dispatcher.Dispatch(
                        Payload <ActionTypes> .From(ActionTypes.OpenDialog, DialogType.LandingScreen));
                    UIStateManager.current.Dispatcher.Dispatch(Payload <ActionTypes> .From(ActionTypes.CloseProject,
                                                                                           UIStateManager.current.projectStateData.activeProject));
                    m_WelcomePanel.SetActive(true);
                    m_NoProjectPanel.SetActive(false);
                    m_RefreshButton.gameObject.SetActive(false);
                    break;

                case LoginState.LoggingIn:
                case LoginState.LoggingOut:
                    // todo put spinner
                    break;
                }

                m_LoginState = data.sessionState.loggedState;
            }

            if (m_Projects != data.sessionState.projects)
            {
                InstantiateProjectItems(data.sessionState.projects);
                m_Projects = data.sessionState.projects;
            }
        }
        void OnSessionStateDataChanged(UISessionStateData data)
        {
            if (!m_LoginState.HasValue || m_LoginState != data.sessionState.loggedState)
            {
                switch (data.sessionState.loggedState)
                {
                case LoginState.LoggedIn:
                    SetPanelActive(true);
                    break;

                case LoginState.LoggedOut:
                    SetPanelActive(false);
                    break;

                case LoginState.LoggingIn:
                    break;

                case LoginState.LoggingOut:
                    break;
                }
                m_LoginState = data.sessionState.loggedState;
            }
        }
示例#11
0
 public static UISessionStateData Validate(UISessionStateData state)
 {
     return(state);
 }
        void OnSessionStateDataChanged(UISessionStateData data)
        {
            if (m_LoginState != data.sessionState.loggedState)
            {
                switch (data.sessionState.loggedState)
                {
                case LoginState.LoggedIn:
                    m_NoProjectPanel.SetActive(false);
                    m_FetchingProjectsPanel.SetActive(true);
                    break;

                case LoginState.LoggedOut:
                    ClearProjectListItem();
                    m_NoProjectPanel.SetActive(false);
                    m_FetchingProjectsPanel.SetActive(false);
                    break;

                case LoginState.LoggingIn:
                case LoginState.LoggingOut:
                    // todo put spinner
                    break;
                }

                m_LoginState = data.sessionState.loggedState;
            }

            if (m_LoginState == LoginState.LoggedIn)
            {
                // Display Cloud environment debug info when it's not "Production"
                var environmentInfo = LocaleUtils.GetEnvironmentInfo();
                if (environmentInfo.cloudEnvironment != CloudEnvironment.Production)
                {
                    m_CloudSettingDebugInfo.gameObject.SetActive(true);

                    if (environmentInfo.cloudEnvironment == CloudEnvironment.Other)
                    {
                        if (PlayerPrefs.HasKey(LocaleUtils.SettingsKeys.CloudEnvironment))
                        {
                            m_CloudSettingDebugInfo.text = $"Environment: {environmentInfo.customUrl}";
                        }
                        else
                        {
                            m_CloudSettingDebugInfo.text =
                                $"Environment: {ProjectServerClient.ProjectServerAddress(environmentInfo.provider)}";
                        }
                    }
                    else
                    {
                        m_CloudSettingDebugInfo.text = $"Environment: {environmentInfo.cloudEnvironment}";
                    }
                }
                else
                {
                    m_CloudSettingDebugInfo.gameObject.SetActive(false);
                }

                UpdateProjectItems(data.sessionState.rooms);

                if (m_Rooms != data.sessionState.rooms || !EnumerableExtension.SafeSequenceEquals(m_Rooms, data.sessionState.rooms))
                {
                    m_Rooms = data.sessionState.rooms;
                }
                else if (HasNoProjectsAvailable())
                {
                    m_NoProjectPanel.SetActive(true);
                    m_FetchingProjectsPanel.SetActive(false);
                }
            }
        }
 void OnSessionStateChanged(UISessionStateData sessionStateData)
 {
     m_WelcomeText.text = sessionStateData.sessionState.linkShareLoggedOut ?
                          "Log in with your Unity account to open the shared project" : "Login with your Unity account to get started";
 }
示例#14
0
 void OnSessionStateChanged(UISessionStateData data)
 {
     m_CurrentUserId = data.sessionState.user?.UserId;
 }