示例#1
0
        public void SelectARMode(SetARModeAction.ARMode arMode)
        {
            if (arMode == SetARModeAction.ARMode.None)
            {
                return;
            }

            Dispatcher.Dispatch(SetWalkEnableAction.From(false));

            var currentNavigationMode = m_NavigationModeSelector.GetValue() == SetNavigationModeAction.NavigationMode.Walk
                ? SetNavigationModeAction.NavigationMode.Orbit
                : m_NavigationModeSelector.GetValue();

            if (currentNavigationMode != SetNavigationModeAction.NavigationMode.AR)
            {
                Dispatcher.Dispatch(UnloadSceneActions <Project> .From(UIStateManager.current.GetSceneDictionary()[currentNavigationMode]));
                Dispatcher.Dispatch(LoadSceneActions <Project> .From(UIStateManager.current.GetSceneDictionary()[SetNavigationModeAction.NavigationMode.AR]));
            }

            Dispatcher.Dispatch(OpenDialogAction.From(OpenDialogAction.DialogType.None));
            Dispatcher.Dispatch(ClearStatusAction.From(true));
            Dispatcher.Dispatch(ClearStatusAction.From(false));
            Dispatcher.Dispatch(SetInstructionMode.From(false));
            Dispatcher.Dispatch(CloseAllDialogsAction.From(null));
            Dispatcher.Dispatch(SetNavigationModeAction.From(SetNavigationModeAction.NavigationMode.AR));
            Dispatcher.Dispatch(SetARModeAction.From(arMode));
        }
示例#2
0
        void OnFlyButtonClicked()
        {
            Dispatcher.Dispatch(CloseAllDialogsAction.From(null));

            var currentNavigationMode = m_NavigationModeSelector.GetValue();

            if (currentNavigationMode == SetNavigationModeAction.NavigationMode.Orbit ||
                currentNavigationMode == SetNavigationModeAction.NavigationMode.Fly)
            {
                return;
            }

            m_WalkButton.button.interactable = true;

            CheckDeviceCapability(m_DeviceCapabilitySelector.GetValue());

            Dispatcher.Dispatch(ShowModelAction.From(true));

            Dispatcher.Dispatch(SetAREnabledAction.From(false));

            Dispatcher.Dispatch(SetVREnableAction.From(false));

            Dispatcher.Dispatch(ClearStatusAction.From(true));
            Dispatcher.Dispatch(ClearStatusAction.From(false));
            Dispatcher.Dispatch(SetInstructionMode.From(false));

            if (currentNavigationMode != SetNavigationModeAction.NavigationMode.Walk)
            {
                Dispatcher.Dispatch(UnloadSceneActions <Project> .From(m_SceneDictionary[currentNavigationMode]));
                Dispatcher.Dispatch(SetCameraViewTypeAction.From(SetCameraViewTypeAction.CameraViewType.Default));
            }

            Dispatcher.Dispatch(SetActiveToolBarAction.From(SetActiveToolBarAction.ToolbarType.OrbitSidebar));

            Dispatcher.Dispatch(SetThemeAction.From(ThemeController.k_Default));

            Dispatcher.Dispatch(SetWalkEnableAction.From(false));

            Dispatcher.Dispatch(EnableAllNavigationAction.From(true));
            Dispatcher.Dispatch(SetNavigationModeAction.From(SetNavigationModeAction.NavigationMode.Orbit));
            Dispatcher.Dispatch(SetShowScaleReferenceAction.From(false));

            Dispatcher.Dispatch(LoadSceneActions <Project> .From(m_SceneDictionary[SetNavigationModeAction.NavigationMode.Orbit]));

            Dispatcher.Dispatch(EnableBimFilterAction.From(true));
            Dispatcher.Dispatch(EnableSceneSettingsAction.From(true));
            Dispatcher.Dispatch(EnableSunStudyAction.From(true));
            Dispatcher.Dispatch(EnableMarkerSettingsAction.From(true));

            var arToolStateData = SetARToolStateAction.SetARToolStateData.defaultData;

            arToolStateData.selectionEnabled   = true;
            arToolStateData.measureToolEnabled = true;
            Dispatcher.Dispatch(SetARToolStateAction.From(arToolStateData));
        }
示例#3
0
 public void Cancel()
 {
     m_WalkModeInstructionUI = WalkModeInstructionUI.Init;
     m_WalkModeSwitcher.OnQuitWalkMode();
     Dispatcher.Dispatch(SetWalkEnableAction.From(false));
     Dispatcher.Dispatch(SetInstructionMode.From(false));
     if (m_NavigationModeSelector.GetValue() == SetNavigationModeAction.NavigationMode.Walk)
     {
         SetNavigationState(SetNavigationModeAction.NavigationMode.Orbit);
     }
 }
示例#4
0
        void OnLogoutButtonClick()
        {
            if (m_LoginStateSelector.GetValue() == LoginState.LoggedIn)
            {
                Dispatcher.Dispatch(SetStatusMessage.From("Logging out..."));
                Dispatcher.Dispatch(CloseAllDialogsAction.From(null));
                Dispatcher.Dispatch(SetWalkEnableAction.From(false));
                Dispatcher.Dispatch(SetLoginAction.From(LoginState.LoggingOut));

                Dispatcher.Dispatch(SetDeltaDNAButtonAction.From($"Logout"));
            }
        }
示例#5
0
        void OnWalkButtonClicked()
        {
            if (m_NavigationModeSelector.GetValue() == SetNavigationModeAction.NavigationMode.AR)
            {
                OnFlyButtonClicked();
            }

            Dispatcher.Dispatch(CloseAllDialogsAction.From(null));
            Dispatcher.Dispatch(SetNavigationModeAction.From(SetNavigationModeAction.NavigationMode.Walk));
            Dispatcher.Dispatch(SetWalkEnableAction.From(true));

            m_WalkInstructionSelector.GetValue().Next();
        }
示例#6
0
        void ActivateVRmode()
        {
            m_WalkButton.button.interactable = false;
            m_VRButton.button.interactable   = false;
            var currentNavigationMode = m_NavigationModeSelector.GetValue();

            Dispatcher.Dispatch(SetAREnabledAction.From(false));

            Dispatcher.Dispatch(ClearStatusAction.From(true));
            Dispatcher.Dispatch(ClearStatusAction.From(false));

            Dispatcher.Dispatch(SetInstructionMode.From(false));

            if (currentNavigationMode != SetNavigationModeAction.NavigationMode.Walk)
            {
                Dispatcher.Dispatch(UnloadSceneActions <Project> .From(m_SceneDictionary[currentNavigationMode]));
            }

            Dispatcher.Dispatch(CloseAllDialogsAction.From(null));

            Dispatcher.Dispatch(SetActiveToolBarAction.From(SetActiveToolBarAction.ToolbarType.VRSidebar));

            Dispatcher.Dispatch(SetThemeAction.From(ThemeController.k_VROpaque));

            Dispatcher.Dispatch(SetWalkEnableAction.From(false));

            Dispatcher.Dispatch(SetVREnableAction.From(true));

            Dispatcher.Dispatch(EnableAllNavigationAction.From(true));
            Dispatcher.Dispatch(SetNavigationModeAction.From(SetNavigationModeAction.NavigationMode.VR));
            Dispatcher.Dispatch(SetShowScaleReferenceAction.From(false));

            Dispatcher.Dispatch(LoadSceneActions <Project> .From(m_SceneDictionary[SetNavigationModeAction.NavigationMode.VR]));

            Dispatcher.Dispatch(EnableBimFilterAction.From(true));
            Dispatcher.Dispatch(EnableSceneSettingsAction.From(true));
            Dispatcher.Dispatch(EnableSunStudyAction.From(true));
            Dispatcher.Dispatch(EnableMarkerSettingsAction.From(true));

            Dispatcher.Dispatch(ToggleMeasureToolAction.From(ToggleMeasureToolAction.ToggleMeasureToolData.defaultData));
        }
示例#7
0
        void OnProjectOpenButtonClick(Project project)
        {
            if (!ReflectProjectsManager.IsReadyForOpening(project))
            {
                return;
            }

            var activeProject = m_ActiveProjectGetter.GetValue();

            if (activeProject?.serverProjectId == project.serverProjectId)
            {
                Dispatcher.Dispatch(OpenDialogAction.From(OpenDialogAction.DialogType.None));
                //if the project already opened, just close landing screen
                return;
            }
            Dispatcher.Dispatch(SetWalkEnableAction.From(false));

            activeProject = project;

            if (activeProject != Project.Empty)
            {
                if (m_NavigationModeGetter.GetValue() != SetNavigationModeAction.NavigationMode.VR)
                {
                    // switch to orbit mode
                    var data = new SetForceNavigationModeAction.ForceNavigationModeTrigger((int)SetNavigationModeAction.NavigationMode.Orbit);
                    Dispatcher.Dispatch(SetForceNavigationModeAction.From(data));
                }

                // first close current Project if open
                Dispatcher.Dispatch(SetStatusMessage.From("Closing {UIStateManager.current.projectStateData.activeProject.name}..."));
            }
            Dispatcher.Dispatch(SetStatusMessage.From($"Opening {activeProject.name}..."));
            Dispatcher.Dispatch(CloseAllDialogsAction.From(null));

            Dispatcher.Dispatch(SetIsOpenWithLinkSharingAction.From(false));
            Dispatcher.Dispatch(SetCachedLinkTokenAction.From(string.Empty));

            Dispatcher.Dispatch(OpenProjectActions <Project> .From(activeProject));
            Dispatcher.Dispatch(ToggleMeasureToolAction.From(ToggleMeasureToolAction.ToggleMeasureToolData.defaultData));
        }
示例#8
0
        void ToggleFollowUserTool()
        {
            var networkUserData = m_UsersSelector.GetValue().Find(user => user.matchmakerId == MatchmakerId);

            if (m_NavigationModeSelector.GetValue() == SetNavigationModeAction.NavigationMode.VR)
            {
                if (!ReferenceEquals(networkUserData.visualRepresentation, null))
                {
                    Dispatcher.Dispatch(TeleportAction.From(networkUserData.visualRepresentation.transform.position));
                }
            }
            else
            {
                Dispatcher.Dispatch(SetWalkEnableAction.From(false));

                var followUserData = new FollowUserAction.FollowUserData();
                followUserData.matchmakerId = networkUserData.matchmakerId;
                followUserData.visualRepresentationGameObject = networkUserData.visualRepresentation.gameObject;
                Dispatcher.Dispatch(FollowUserAction.From(followUserData));
                Dispatcher.Dispatch(SetDeltaDNAButtonAction.From($"FollowUser"));
            }
        }