コード例 #1
0
        void Awake()
        {
            UIStateManager.stateChanged += OnStateDataChanged;

            m_OrbitButton.buttonClicked      += OnOrbitButtonClicked;
            m_OrbitButton.buttonLongPressed  += OnOrbitButtonLongPressed;
            m_LookAroundButton.buttonClicked += OnLookAroundButtonClicked;
            m_SelectButton.buttonClicked     += OnSelectButtonClicked;
            m_SunStudyButton.buttonClicked   += OnSunStudyButtonClicked;

            m_ObjectSelector = new SpatialSelector();
        }
コード例 #2
0
        void Awake()
        {
            UIStateManager.stateChanged   += OnStateDataChanged;
            UIStateManager.arStateChanged += OnARStateDataChanged;

            m_BackButton.buttonClicked   += OnBackButtonClicked;
            m_SelectButton.buttonClicked += OnSelectButtonClicked;
            m_ScaleButton.buttonClicked  += OnScaleButtonClicked;
            m_TargetButton.buttonClicked += OnTargetButtonClicked;

            OnStateDataChanged(UIStateManager.current.stateData);
            OnARStateDataChanged(UIStateManager.current.arStateData);
            m_ObjectSelector = new SpatialSelector();
        }
        void Awake()
        {
            ToolStateContext.current.stateChanged += UpdateToolState;

            m_DisposeOnDestroy.Add(m_MeasureToolStateSelector    = UISelectorFactory.createSelector <bool>(MeasureToolContext.current, nameof(IMeasureToolDataProvider.toolState), OnToolStateDataChanged));
            m_DisposeOnDestroy.Add(m_ObjectSelectionInfoSelector = UISelectorFactory.createSelector <SelectObjectAction.IObjectSelectionInfo>(ProjectContext.current, nameof(IObjectSelectorDataProvider.objectSelectionInfo)));
            m_DisposeOnDestroy.Add(UISelectorFactory.createSelector <bool>(UIStateContext.current, nameof(IToolBarDataProvider.toolbarsEnabled), OnToolbarEnabledChanged));
            m_DisposeOnDestroy.Add(m_ActiveToolSelector   = UISelectorFactory.createSelector <SetActiveToolAction.ToolType>(ToolStateContext.current, nameof(IToolStateDataProvider.activeTool)));
            m_DisposeOnDestroy.Add(m_OrbitTypeSelector    = UISelectorFactory.createSelector <SetOrbitTypeAction.OrbitType>(ToolStateContext.current, nameof(IToolStateDataProvider.orbitType)));
            m_DisposeOnDestroy.Add(m_ActiveDialogSelector = UISelectorFactory.createSelector <OpenDialogAction.DialogType>(UIStateContext.current, nameof(IDialogDataProvider.activeDialog)));

            m_SelectButton.buttonClicked      += OnSelectButtonClicked;
            m_MeasureToolButton.buttonClicked += OnMeasureToolButtonClicked;

            m_ObjectSelector = new SpatialSelector();
        }
コード例 #4
0
        void Awake()
        {
            m_SelectButton.buttonClicked += OnSelectButtonClicked;

            m_DisposeOnDestroy.Add(UISelectorFactory.createSelector <ObjectSelectionInfo>(ProjectContext.current,
                                                                                          nameof(IObjectSelectorDataProvider.objectSelectionInfo), OnObjectSelectionChanged));
            m_DisposeOnDestroy.Add(UISelectorFactory.createSelector <string>(ProjectContext.current,
                                                                             nameof(IProjectSortDataProvider.bimSearchString), OnBimSearchStringChanged));
            m_DisposeOnDestroy.Add(UISelectorFactory.createSelector <OpenDialogAction.DialogType>(UIStateContext.current,
                                                                                                  nameof(IDialogDataProvider.activeDialog), OnActiveDialogChanged));
            m_DisposeOnDestroy.Add(m_ActiveToolSelector = UISelectorFactory.createSelector <SetActiveToolAction.ToolType>(ToolStateContext.current,
                                                                                                                          nameof(IToolStateDataProvider.activeTool)));
            m_DisposeOnDestroy.Add(UISelectorFactory.createSelector <string>(UIStateContext.current,
                                                                             nameof(IUIStateDataProvider.bimGroup),
                                                                             bimGroup =>
            {
                if (bimGroup == m_CurrentBimGroup)
                {
                    return;
                }

                if (string.IsNullOrEmpty(bimGroup))
                {
                    return;
                }

                m_CurrentBimGroup = bimGroup;
                RefreshShownBimItems();
            }));

            m_DialogWindow = GetComponent <DialogWindow>();

            m_BimGroupDropdown.onValueChanged.AddListener(OnBimGroupChanged);
            m_BimGroupDropdown.options.Add(k_AllInfoOption);

            m_SearchInput.onValueChanged.AddListener(OnSearchInputTextChanged);
            m_SearchInput.onDeselect.AddListener(OnSearchInputDeselected);
            m_SearchInput.onSelect.AddListener(OnSearchInputSelected);

            m_CancelButton.onClick.AddListener(OnCancelButtonClicked);

            m_NoSelectionText.text = k_DefaultNoSelectionText;
            m_NoSelectionText.gameObject.SetActive(true);

            m_ObjectSelector = new SpatialSelector();
        }
コード例 #5
0
        void Awake()
        {
            m_MeasureToolButton.buttonClicked += OnMeasureToolButtonClicked;
            SetCurrentCursor(m_CursorA, m_CursorB);
            m_VRMeasureTool  = GetComponent <VRMeasureToolController>();
            m_ObjectSelector = new SpatialSelector();

            m_PlainLineMaterial       = m_Line.material;
            m_PerpendicularModeSprite = m_ModeSwitchImage.sprite;
            m_ModeSwitchButton        = m_ModeSwitchImage.transform.parent.GetComponent <Button>();

            m_DisposeOnDestroy.Add(m_MeasureToolStateGetter    = UISelectorFactory.createSelector <bool>(MeasureToolContext.current, nameof(IMeasureToolDataProvider.toolState), OnToolStateDataChanged));
            m_DisposeOnDestroy.Add(m_ObjectSelectionInfoGetter = UISelectorFactory.createSelector <SelectObjectAction.IObjectSelectionInfo>(ProjectContext.current, nameof(IObjectSelectorDataProvider.objectSelectionInfo)));

            m_DisposeOnDestroy.Add(UISelectorFactory.createSelector <float>(UIStateContext.current, nameof(IUIStateDisplayProvider <DisplayData> .display) + "." + nameof(IDisplayDataProvider.scaleFactor), OnScaleFactorChanged));
            m_DisposeOnDestroy.Add(UISelectorFactory.createSelector <bool>(MeasureToolContext.current, nameof(IMeasureToolDataProvider.toolState), OnToolStateDataChanged));
            m_DisposeOnDestroy.Add(UISelectorFactory.createSelector <ToggleMeasureToolAction.MeasureFormat>(MeasureToolContext.current, nameof(IMeasureToolDataProvider.measureFormat), OnMeasureFormatDataChanged));
            m_DisposeOnDestroy.Add(m_MeasureModeGetter = UISelectorFactory.createSelector <ToggleMeasureToolAction.MeasureMode>(MeasureToolContext.current, nameof(IMeasureToolDataProvider.measureMode), OnMeasureModeDataChanged));
            m_DisposeOnDestroy.Add(UISelectorFactory.createSelector <ToggleMeasureToolAction.AnchorType>(MeasureToolContext.current, nameof(IMeasureToolDataProvider.selectionType), OnSelectionTypeDataChanged));
            m_DisposeOnDestroy.Add(UISelectorFactory.createSelector <SelectObjectMeasureToolAction.IAnchor>(MeasureToolContext.current, nameof(IMeasureToolDataProvider.selectedAnchor), OnSelectedAnchorsDataChanged));

            m_DisposeOnDestroy.Add(m_VREnableSelector     = UISelectorFactory.createSelector <bool>(VRContext.current, nameof(IVREnableDataProvider.VREnable)));
            m_DisposeOnDestroy.Add(m_VRControllerSelector = UISelectorFactory.createSelector <Transform>(VRContext.current, nameof(IVREnableDataProvider.RightController)));

            m_AnchorSelection = new UIAnchorSelection(m_MeasureText, m_DraggablePad, m_Line, m_MeasureModeGetter.GetValue, m_VREnableSelector.GetValue, m_VRControllerSelector.GetValue);

            m_DisposeOnDestroy.Add(m_HashObjectDraggedSelector = UISelectorFactory.createSelector <int>(DragStateContext.current, nameof(IDragStateData.hashObjectDragged)));

            m_DisposeOnDestroy.Add(UISelectorFactory.createSelector <DragState>(DragStateContext.current, nameof(IDragStateData.dragState), OnDragStateDataChanged));
            m_DisposeOnDestroy.Add(UISelectorFactory.createSelector <Vector3>(DragStateContext.current, nameof(IDragStateData.position), OnDragPositionDataChanged));

            m_DisposeOnDestroy.Add(m_ActiveToolGetter = UISelectorFactory.createSelector <SetActiveToolAction.ToolType>(ToolStateContext.current, nameof(IToolStateDataProvider.activeTool)));
            m_DisposeOnDestroy.Add(UISelectorFactory.createSelector <SetHelpModeIDAction.HelpModeEntryID>(UIStateContext.current, nameof(IHelpModeDataProvider.helpModeEntryId), OnHelpModeEntryChanged));

            m_DraggablePad.onBeginDrag.AddListener(OnBeginDrag);
            m_DraggablePad.onDrag.AddListener(OnDrag);
            m_DraggablePad.onEndDrag.AddListener(OnEndDrag);
            m_ResetButton.onClick.AddListener(OnReset);
            m_ModeSwitchButton.onClick.AddListener(OnSwitchMode);
        }
コード例 #6
0
        void Awake()
        {
            m_LayoutRoot    = GetComponent <RectTransform>();
            m_Buttons       = m_MainRectTransform.GetComponentsInChildren <ToolButton>().OrderBy(b => b.transform.parent.GetSiblingIndex()).ToArray();
            m_HiddenButtons = new List <ToolButton>();

            ToolStateContext.current.stateChanged += UpdateToolState;
            m_SelectButton.buttonClicked          += CloseMeasureTool;
            m_FilterButton.buttonClicked          += CloseTools;
            m_SunstudyButton.buttonClicked        += CloseTools;
            m_SceneSettingsButton.buttonClicked   += CloseTools;
            m_MarkerButton.buttonClicked          += CloseTools;

            m_DisposeOnDestroy.Add(m_ActiveToolSelector = UISelectorFactory.createSelector <SetActiveToolAction.ToolType>(ToolStateContext.current, nameof(IToolStateDataProvider.activeTool)));

            m_DisposeOnDestroy.Add(m_ToolBarEnabledGetter = UISelectorFactory.createSelector <bool>(UIStateContext.current, nameof(IToolBarDataProvider.toolbarsEnabled),
                                                                                                    data =>
            {
                UpdateButtons();
            }));
            m_DisposeOnDestroy.Add(m_BimFilterEnabledGetter = UISelectorFactory.createSelector <bool>(SettingsToolContext.current, nameof(ISettingsToolDataProvider.bimFilterEnabled),
                                                                                                      data =>
            {
                UpdateButtons();
            }));
            m_DisposeOnDestroy.Add(m_SunStudyEnabledGetter = UISelectorFactory.createSelector <bool>(SettingsToolContext.current, nameof(ISettingsToolDataProvider.sunStudyEnabled),
                                                                                                     data =>
            {
                UpdateButtons();
            }));
            m_DisposeOnDestroy.Add(m_SceneSettingEnabledGetter = UISelectorFactory.createSelector <bool>(SettingsToolContext.current, nameof(ISettingsToolDataProvider.sceneSettingsEnabled),
                                                                                                         data =>
            {
                UpdateButtons();
            }));

            m_DisposeOnDestroy.Add(m_MarkerEnabledGetter = UISelectorFactory.createSelector <bool>(SettingsToolContext.current, nameof(ISettingsToolDataProvider.markerSettingsEnabled),
                                                                                                   data =>
            {
                UpdateButtons();
            }));

            m_DisposeOnDestroy.Add(m_SelectEnabledGetter = UISelectorFactory.createSelector <bool>(ARToolStateContext.current, nameof(IARToolStatePropertiesDataProvider.selectionEnabled),
                                                                                                   data =>
            {
                UpdateButtons();
            }));

            m_DisposeOnDestroy.Add(m_MeasureToolEnabledGetter = UISelectorFactory.createSelector <bool>(ARToolStateContext.current, nameof(IARToolStatePropertiesDataProvider.measureToolEnabled),
                                                                                                        data =>
            {
                UpdateButtons();
            }));

            m_DisposeOnDestroy.Add(m_VREnableGetter = UISelectorFactory.createSelector <bool>(VRContext.current, nameof(IVREnableDataProvider.VREnable), OnVREnableChanged));
            m_DisposeOnDestroy.Add(UISelectorFactory.createSelector <bool>(NavigationContext.current, nameof(INavigationDataProvider.gizmoEnabled), OnGizmoEnabledChanged));
            m_DisposeOnDestroy.Add(m_ScaledScreenSizeGetter = UISelectorFactory.createSelector <Vector2>(UIStateContext.current, nameof(IUIStateDisplayProvider <DisplayData> .display) + "." + nameof(IDisplayDataProvider.scaledScreenSize), OnScaledScreenSizeChanged));

            m_MoreButtonController.OnItemClick += OnExtraButtonClicked;

            m_DisposeOnDestroy.Add(m_MeasureToolStateSelector    = UISelectorFactory.createSelector <bool>(MeasureToolContext.current, nameof(IMeasureToolDataProvider.toolState), OnToolStateDataChanged));
            m_DisposeOnDestroy.Add(m_ObjectSelectionInfoSelector = UISelectorFactory.createSelector <SelectObjectAction.IObjectSelectionInfo>(ProjectContext.current, nameof(IObjectSelectorDataProvider.objectSelectionInfo)));

            m_ObjectSelector = new SpatialSelector();
            var verticalLayout = m_LayoutRoot.GetComponent <VerticalLayoutGroup>();

            m_Spacing = verticalLayout.spacing;
        }