Ejemplo n.º 1
0
        void OnMeasureToolButtonClicked()
        {
            // Helpmode
            if (HelpDialogController.SetHelpID(HelpModeEntryID.MeasureTool))
            {
                return;
            }

            var data = UIStateManager.current.externalToolStateData.measureToolStateData;

            data.toolState = !data.toolState;

            if (data.toolState)
            {
                Dispatcher.Dispatch(Payload <ActionTypes> .From(ActionTypes.SetStatusWithType,
                                                                new StatusMessageData()
                {
                    text = UIMeasureToolController.instructionStart, type = StatusMessageType.Instruction
                }));
            }
            else
            {
                Dispatcher.Dispatch(Payload <ActionTypes> .From(ActionTypes.ClearStatus, ""));
            }

            Dispatcher.Dispatch(Payload <ActionTypes> .From(ActionTypes.SetMeasureToolOptions, data));
        }
Ejemplo n.º 2
0
        void OnOrbitButtonClicked()
        {
            // Helpmode
            if (HelpDialogController.SetHelpID(HelpModeEntryID.OrbitSelect))
            {
                return;
            }

            if (m_SelectButton.selected)
            {
                UIStateManager.current.Dispatcher.Dispatch(Payload <ActionTypes> .From(ActionTypes.OpenSubDialog, DialogType.None));
            }

            var toolState = UIStateManager.current.stateData.toolState;

            if (UIStateManager.current.stateData.activeDialog == DialogType.OrbitSelect)
            {
                UIStateManager.current.Dispatcher.Dispatch(Payload <ActionTypes> .From(ActionTypes.OpenDialog, DialogType.None));
            }

            if (m_OrbitButton.selected)
            {
                toolState.activeTool = ToolType.None;
            }
            else
            {
                toolState.activeTool = m_CurrentOrbitButtonType;
                toolState.orbitType  = OrbitType.OrbitAtPoint;
            }
            UIStateManager.current.Dispatcher.Dispatch(Payload <ActionTypes> .From(ActionTypes.SetToolState, toolState));
        }
Ejemplo n.º 3
0
        void OnSunStudyButtonClicked()
        {
            // Helpmode
            if (HelpDialogController.SetHelpID(HelpModeEntryID.SunStudyDial))
            {
                return;
            }

            if (UIStateManager.current.stateData.activeDialog == DialogType.OrbitSelect)
            {
                UIStateManager.current.Dispatcher.Dispatch(Payload <ActionTypes> .From(ActionTypes.OpenDialog, DialogType.None));
            }
            if (m_SelectButton.selected)
            {
                UIStateManager.current.Dispatcher.Dispatch(Payload <ActionTypes> .From(ActionTypes.OpenSubDialog, DialogType.None));
            }
            UIStateManager.current.Dispatcher.Dispatch(Payload <ActionTypes> .From(ActionTypes.SetSunStudyMode, false));
            UIStateManager.current.Dispatcher.Dispatch(Payload <ActionTypes> .From(ActionTypes.SetActiveToolbar, ToolbarType.TimeOfDayYearDial));
            var toolState = UIStateManager.current.stateData.toolState;

            toolState.activeTool = ToolType.SunstudyTool;
            UIStateManager.current.Dispatcher.Dispatch(Payload <ActionTypes> .From(ActionTypes.SetToolState, toolState));
            var sunStudyData = UIStateManager.current.stateData.sunStudyData;

            UIStateManager.current.Dispatcher.Dispatch(Payload <ActionTypes> .From(ActionTypes.SetStatus, TimeRadialUIController.GetTimeStatusMessage(sunStudyData)));
        }
 void OnCancelButtonClicked()
 {
     // Helpmode
     if (HelpDialogController.SetHelpID(SetHelpModeIDAction.HelpModeEntryID.Cancel))
     {
         return;
     }
     Dispatcher.Dispatch(CancelAction.From(true));
 }
Ejemplo n.º 5
0
 void OnCancelButtonClicked()
 {
     // Helpmode
     if (HelpDialogController.SetHelpID(HelpModeEntryID.Cancel))
     {
         return;
     }
     Dispatcher.Dispatch(Payload <ActionTypes> .From(ActionTypes.Cancel, true));
 }
Ejemplo n.º 6
0
 void OnBackButtonClicked()
 {
     // Helpmode
     if (HelpDialogController.SetHelpID(HelpModeEntryID.Back))
     {
         return;
     }
     UIStateManager.current.arStateData.currentInstructionUI.Back();
 }
 void OnBackButtonClicked()
 {
     // Helpmode
     if (HelpDialogController.SetHelpID(SetHelpModeIDAction.HelpModeEntryID.Back))
     {
         return;
     }
     m_CurrentARInstructionUISelector.GetValue().Back();
 }
Ejemplo n.º 8
0
        void OnResetButtonClicked()
        {
            // Helpmode
            if (HelpDialogController.SetHelpID(HelpModeEntryID.HomeReset))
            {
                return;
            }

            UIStateManager.current.Dispatcher.Dispatch(Payload <ActionTypes> .From(ActionTypes.ResetHomeView, null));
        }
        void OnButtonClick()
        {
            // Helpmode
            if (HelpDialogController.SetHelpID(SetHelpModeIDAction.HelpModeEntryID.Sync))
            {
                return;
            }

            Dispatcher.Dispatch(EnableSyncModeAction.From(!m_SyncEnabledSelector.GetValue()));
        }
        void OnResetButtonClicked()
        {
            // Helpmode
            if (HelpDialogController.SetHelpID(SetHelpModeIDAction.HelpModeEntryID.HomeReset))
            {
                return;
            }

            OnInteraction();
            Reset();
        }
        void OnSyncButtonClick()
        {
            // Helpmode
            if (HelpDialogController.SetHelpID(HelpModeEntryID.Sync))
            {
                return;
            }

            var enabled = !UIStateManager.current.stateData.syncEnabled;

            UIStateManager.current.Dispatcher.Dispatch(Payload <ActionTypes> .From(ActionTypes.SetSync, enabled));
        }
Ejemplo n.º 12
0
        void Awake()
        {
            Assert.IsNull(s_Instance);
            s_Instance = this;

            m_DisposeOnDestroy.Add(m_DialogModeSelector = UISelectorFactory.createSelector <SetDialogModeAction.DialogMode>(UIStateContext.current, nameof(IDialogDataProvider.dialogMode),
                                                                                                                            mode =>
            {
                m_HelpScreenBackground.SetActive(mode == SetDialogModeAction.DialogMode.Help);
            }));

            m_DisposeOnDestroy.Add(UISelectorFactory.createSelector <SetHelpModeIDAction.HelpModeEntryID>(UIStateContext.current, nameof(IHelpModeDataProvider.helpModeEntryId), OnHelpModeEntryChanged));
        }
        void OnButtonClick()
        {
            // Helpmode
            if (HelpDialogController.SetHelpID(HelpModeEntryID.Microphone))
            {
                return;
            }

            if (HasPermission())
            {
                var matchmakerId = UIStateManager.current.roomConnectionStateData.localUser.matchmakerId;
                Dispatcher.Dispatch(Payload <ActionTypes> .From(ActionTypes.ToggleUserMicrophone, matchmakerId));
            }
        }
        void OnBackButtonClicked()
        {
            // Helpmode
            if (HelpDialogController.SetHelpID(HelpModeEntryID.Back))
            {
                return;
            }

            if (UIStateManager.current.stateData.activeDialog == DialogType.OrbitSelect)
            {
                Dispatcher.Dispatch(Payload <ActionTypes> .From(ActionTypes.OpenDialog, DialogType.None));
            }

            UIStateManager.current.arStateData.currentInstructionUI.Back();
        }
        void OnScaleButtonClicked()
        {
            // Helpmode
            if (HelpDialogController.SetHelpID(SetHelpModeIDAction.HelpModeEntryID.Scale))
            {
                return;
            }
            Dispatcher.Dispatch(SetActiveToolBarAction.From(SetActiveToolBarAction.ToolbarType.ARScaleDial));
            ARScaleRadialUIController.m_previousToolbar = SetActiveToolBarAction.ToolbarType.ARInstructionSidebar;

            var radialPosition = m_ScaleRadial.transform.position;

            radialPosition.y = m_ScaleButton.transform.position.y;
            m_ScaleRadial.transform.position = radialPosition;
        }
Ejemplo n.º 16
0
        void OnScaleButtonClicked()
        {
            // Helpmode
            if (HelpDialogController.SetHelpID(HelpModeEntryID.Scale))
            {
                return;
            }
            Dispatcher.Dispatch(Payload <ActionTypes> .From(ActionTypes.SetActiveToolbar, ToolbarType.ARScaleDial));
            ARScaleRadialUIController.m_previousToolbar = ToolbarType.ARSidebar;

            var radialPosition = m_ScaleRadial.transform.position;

            radialPosition.y = m_ScaleButton.transform.position.y;
            m_ScaleRadial.transform.position = radialPosition;
        }
Ejemplo n.º 17
0
        void OnButtonClick()
        {
            // Helpmode
            if (HelpDialogController.SetHelpID(SetHelpModeIDAction.HelpModeEntryID.Microphone))
            {
                return;
            }

            if (HasPermission())
            {
                var matchmakerId = m_LocalUserGetter.GetValue().matchmakerId;
                Dispatcher.Dispatch(ToggleMicrophoneAction.From(matchmakerId));
                Dispatcher.Dispatch(SetDeltaDNAButtonAction.From($"MicrophoneMuteToggle_{m_MicToggleOffImage.activeSelf}"));
            }
        }
        void OnLookAroundButtonClicked()
        {
            // Helpmode
            if (HelpDialogController.SetHelpID(HelpModeEntryID.LookAround))
            {
                return;
            }

            if (UIStateManager.current.stateData.activeDialog == DialogType.OrbitSelect)
            {
                Dispatcher.Dispatch(Payload <ActionTypes> .From(ActionTypes.OpenDialog, DialogType.None));
            }

            var toolState = UIStateManager.current.stateData.toolState;

            toolState.activeTool = m_LookAroundButton.selected ? ToolType.None : ToolType.OrbitTool;
            toolState.orbitType  = OrbitType.WorldOrbit;
            Dispatcher.Dispatch(Payload <ActionTypes> .From(ActionTypes.SetToolState, toolState));
        }
        void OnMeasureToolButtonClicked()
        {
            // Helpmode
            if (HelpDialogController.SetHelpID(SetHelpModeIDAction.HelpModeEntryID.MeasureTool))
            {
                return;
            }

            var toggleData = ToggleMeasureToolAction.ToggleMeasureToolData.defaultData;

            toggleData.toolState = !m_MeasureToolStateSelector.GetValue();

            if (toggleData.toolState)
            {
                if (m_ActiveToolSelector.GetValue() == SetActiveToolAction.ToolType.SelectTool && ((ObjectSelectionInfo)m_ObjectSelectionInfoSelector.GetValue()).CurrentSelectedObject() == null)
                {
                    Dispatcher.Dispatch(SetActiveToolAction.From(SetActiveToolAction.ToolType.None));
                    Dispatcher.Dispatch(OpenSubDialogAction.From(OpenDialogAction.DialogType.None));
                }

                Dispatcher.Dispatch(SetStatusMessageWithType.From(
                                        new StatusMessageData()
                {
                    text = MeasureToolUIController.instructionStart, type = StatusMessageType.Instruction
                }));
            }
            else
            {
                Dispatcher.Dispatch(ClearStatusAction.From(true));
                Dispatcher.Dispatch(ClearStatusAction.From(false));
            }

            Dispatcher.Dispatch(ToggleMeasureToolAction.From(toggleData));

            // To initialize Anchor
            Dispatcher.Dispatch(SetSpatialSelectorAction.From(m_ObjectSelector));

            if (m_SelectButton.selected)
            {
                Dispatcher.Dispatch(SetActiveToolAction.From(SetActiveToolAction.ToolType.None));
                Dispatcher.Dispatch(OpenSubDialogAction.From(OpenDialogAction.DialogType.None));
            }
        }
Ejemplo n.º 20
0
        void OnProjectListButtonClick()
        {
            // Helpmode
            if (HelpDialogController.SetHelpID(SetHelpModeIDAction.HelpModeEntryID.Projects))
            {
                m_ProjectListButton.selected = true;
                return;
            }

            Dispatcher.Dispatch(OpenSubDialogAction.From(OpenDialogAction.DialogType.None));
            var dialogType = m_ActiveDialogSelector.GetValue() == OpenDialogAction.DialogType.LandingScreen ? OpenDialogAction.DialogType.None : OpenDialogAction.DialogType.LandingScreen;

            Dispatcher.Dispatch(OpenDialogAction.From(dialogType));
            if (dialogType == OpenDialogAction.DialogType.None)
            {
                Dispatcher.Dispatch(CloseAllDialogsAction.From(null));
                Dispatcher.Dispatch(ResetToolBarAction.From(null));
                Dispatcher.Dispatch(ToggleMeasureToolAction.From(ToggleMeasureToolAction.ToggleMeasureToolData.defaultData));
                Dispatcher.Dispatch(ClearStatusAction.From(true));
                Dispatcher.Dispatch(ClearStatusAction.From(false));
            }
        }
        void OnDialogButtonClick()
        {
            // Helpmode
            if (HelpDialogController.SetHelpID(HelpModeEntryID.LinkSharing))
            {
                return;
            }

            var dialogType = m_DialogWindow.open ? DialogType.None : DialogType.LinkSharing;

            Dispatcher.Dispatch(Payload <ActionTypes> .From(ActionTypes.OpenSubDialog, dialogType));
            if (dialogType == DialogType.LinkSharing)
            {
                var linkSharingManager = UIStateManager.current.m_LinkSharingManager;
                linkSharingManager.GetSharingLinkInfo(UIStateManager.current.sessionStateData.sessionState.user.AccessToken, UIStateManager.current.projectStateData.activeProject);
            }
            else
            {
                Dispatcher.Dispatch(Payload <ActionTypes> .From(ActionTypes.ClearStatus, null));
                m_Link = null;
            }
        }
Ejemplo n.º 22
0
        void OnMeasureToolButtonClicked()
        {
            // Helpmode
            if (HelpDialogController.SetHelpID(HelpModeEntryID.MeasureTool))
            {
                return;
            }

            var data = UIStateManager.current.externalToolStateData.measureToolStateData;

            data.toolState = !data.toolState;

            if (data.toolState)
            {
                if (UIStateManager.current.stateData.toolState.activeTool == ToolType.SelectTool && UIStateManager.current.projectStateData.objectSelectionInfo.CurrentSelectedObject() == null)
                {
                    var toolState = UIStateManager.current.stateData.toolState;
                    toolState.activeTool = ToolType.None;
                    Dispatcher.Dispatch(Payload <ActionTypes> .From(ActionTypes.SetToolState, toolState));
                    Dispatcher.Dispatch(Payload <ActionTypes> .From(ActionTypes.OpenSubDialog, DialogType.None));
                }

                Dispatcher.Dispatch(Payload <ActionTypes> .From(ActionTypes.SetStatusWithType,
                                                                new StatusMessageData()
                {
                    text = UIMeasureToolController.instructionStart, type = StatusMessageType.Instruction
                }));
            }
            else
            {
                Dispatcher.Dispatch(Payload <ActionTypes> .From(ActionTypes.ClearStatus, ""));
            }

            Dispatcher.Dispatch(Payload <ActionTypes> .From(ActionTypes.SetMeasureToolOptions, data));

            // To initialize Anchor
            Dispatcher.Dispatch(Payload <ActionTypes> .From(ActionTypes.SetObjectPicker, m_ObjectSelector));
        }
Ejemplo n.º 23
0
        void OnDialogButtonClick()
        {
            // Helpmode
            if (HelpDialogController.SetHelpID(SetHelpModeIDAction.HelpModeEntryID.LinkSharing))
            {
                m_DialogButton.selected = true;
                return;
            }

            var dialogType = m_DialogWindow.open ? OpenDialogAction.DialogType.None : OpenDialogAction.DialogType.LinkSharing;

            Dispatcher.Dispatch(SetDeltaDNAButtonAction.From($"LinkSharingDialog"));
            Dispatcher.Dispatch(OpenSubDialogAction.From(dialogType));
            if (dialogType == OpenDialogAction.DialogType.LinkSharing)
            {
                var linkSharingManager = UIStateManager.current.m_LinkSharingManager;
                linkSharingManager.GetSharingLinkInfo(UIStateManager.current.projectSettingStateData.accessToken.CloudServicesAccessToken, m_ActiveProjectSelector.GetValue());
            }
            else
            {
                Dispatcher.Dispatch(ClearStatusAction.From(true));
                Dispatcher.Dispatch(ClearStatusAction.From(false));
            }
        }
Ejemplo n.º 24
0
 void OnDestroy()
 {
     Assert.IsTrue(s_Instance == this);
     s_Instance = null;
     m_DisposeOnDestroy.ForEach(x => x.Dispose());
 }
 void Awake()
 {
     Assert.IsNull(s_Instance);
     s_Instance = this;
     UIStateManager.stateChanged += OnStateDataChanged;
 }
 void OnDestroy()
 {
     Assert.IsTrue(s_Instance == this);
     s_Instance = null;
 }