void OnMeasureToolStateDataChanged(bool newData)
 {
     m_SelectMode = m_ActiveToolSelector?.GetValue() == SetActiveToolAction.ToolType.SelectTool && newData == false;
     if (newData)
     {
         StartCoroutine(UnselectObject());
     }
 }
 void LeaveFollowUserMode()
 {
     if (!string.IsNullOrEmpty(m_FollowUserIDSelector?.GetValue()))
     {
         var followUserData = new FollowUserAction.FollowUserData();
         followUserData.matchmakerId = "";
         followUserData.visualRepresentationGameObject = null;
         Dispatcher.Dispatch(FollowUserAction.From(followUserData));
     }
 }
Esempio n. 3
0
        bool UpdateButton(ToolButton button, bool value)
        {
            var enable = (m_ToolBarEnabledGetter?.GetValue() ?? false) && value;

            button.transform.parent.gameObject.SetActive(enable);
            if (m_HiddenButtons.Contains(button))
            {
                m_HiddenButtons.Remove(button);
                return(true);
            }

            return(false);
        }
Esempio n. 4
0
        void UpdateProfile()
        {
            var user = m_UserSelector?.GetValue();

            if (user != null)
            {
                m_UserNameText.text = user.DisplayName;
                var accessToken = user.AccessToken;
                m_LogoutButton.gameObject.SetActive(m_LogOutInteractable &&
                                                    !string.IsNullOrWhiteSpace(accessToken));
            }

            UpdateToggleInteractable();
        }
Esempio n. 5
0
        public void UpdateButtons()
        {
            if (m_ActiveDialogSelector?.GetValue() == OpenDialogAction.DialogType.LandingScreen && m_DialogModeSelector?.GetValue() == SetDialogModeAction.DialogMode.Normal)
            {
                if (m_DialogModeSelector.GetValue() == SetDialogModeAction.DialogMode.Normal)
                {
                    m_ProjectListButton.button.interactable = m_Interactable &&
                                                              m_ActiveProjectSelector.GetValue() != null &&
                                                              m_ActiveProjectSelector.GetValue() != Project.Empty &&
                                                              m_LoginStateSelector.GetValue() == LoginState.LoggedIn;
                    m_RefreshButton.transform.parent.gameObject.SetActive(m_RefreshVisibility);
                }

                m_ProjectListButton.selected = true;
            }
            else
            {
                m_ProjectListButton.button.interactable = m_Interactable;
                m_RefreshButton.transform.parent.gameObject.SetActive(false);
                m_ProjectListButton.selected = false;
            }
        }
Esempio n. 6
0
        void UpdateButtons()
        {
            bool isHiddenButtonDirty = false;

            isHiddenButtonDirty |= UpdateButton(m_FilterButton, m_BimFilterEnabledGetter?.GetValue() ?? false);
            isHiddenButtonDirty |= UpdateButton(m_SunstudyButton, m_SunStudyEnabledGetter?.GetValue() ?? false);
            isHiddenButtonDirty |= UpdateButton(m_SceneSettingsButton, m_SceneSettingEnabledGetter?.GetValue() ?? false);
            isHiddenButtonDirty |= UpdateButton(m_SelectButton, m_SelectEnabledGetter?.GetValue() ?? false);
            isHiddenButtonDirty |= UpdateButton(m_MeasureToolButton, m_MeasureToolEnabledGetter?.GetValue() ?? false);

            isHiddenButtonDirty |= UpdateButton(m_MarkerButton, m_MarkerEnabledGetter?.GetValue() ?? false);

            if (isHiddenButtonDirty)
            {
                m_MoreButtonController.UpdateButtons(m_HiddenButtons);
                if (!m_HiddenButtons.Any())
                {
                    m_MoreButton.transform.parent.gameObject.SetActive(false);
                }
            }

            UpdateLayout();
        }
Esempio n. 7
0
        void Awake()
        {
            m_Button      = GetComponent <Button>();
            m_ButtonImage = m_Button.GetComponent <Image>();

            m_Disposables.Add(m_MeasureToolStateGetter = UISelectorFactory.createSelector <bool>(MeasureToolContext.current, nameof(IMeasureToolDataProvider.toolState)));
            m_Disposables.Add(UISelectorFactory.createSelector <IButtonVisibility>(AppBarContext.current, nameof(IAppBarDataProvider.buttonVisibility), OnButtonVisibilityChanged));
            m_Disposables.Add(UISelectorFactory.createSelector <IButtonInteractable>(AppBarContext.current, nameof(IAppBarDataProvider.buttonInteractable), OnButtonInteractableChanged));
            m_Disposables.Add(m_ActiveToolBarSelector = UISelectorFactory.createSelector <SetActiveToolBarAction.ToolbarType>(UIStateContext.current, nameof(IToolBarDataProvider.activeToolbar)));
            m_Visibility   = true;
            m_Interactable = true;

            m_Disposables.Add(m_ToolBarEnabledSelector = UISelectorFactory.createSelector <bool>(UIStateContext.current,
                                                                                                 nameof(IToolBarDataProvider.toolbarsEnabled), UpdateButtonInteractable));

            m_Disposables.Add(m_DialogModeSelector = UISelectorFactory.createSelector <SetDialogModeAction.DialogMode>(UIStateContext.current, nameof(IDialogDataProvider.dialogMode),
                                                                                                                       data =>
            {
                m_ButtonImage.enabled = data == SetDialogModeAction.DialogMode.Help;
            }));

            m_Disposables.Add(m_ActiveDialogSelector = UISelectorFactory.createSelector <OpenDialogAction.DialogType>(UIStateContext.current, nameof(IDialogDataProvider.activeDialog),
                                                                                                                      data =>
            {
                m_Button.transform.parent.gameObject.SetActive(m_Visibility && data != OpenDialogAction.DialogType.LandingScreen &&
                                                               m_NavigationModeSelector?.GetValue() != SetNavigationModeAction.NavigationMode.AR && m_NavigationModeSelector?.GetValue() != SetNavigationModeAction.NavigationMode.VR);
            }));

            m_Disposables.Add(m_ActiveSubDialogSelector = UISelectorFactory.createSelector <OpenDialogAction.DialogType>(UIStateContext.current, nameof(IDialogDataProvider.activeSubDialog)));

            m_Disposables.Add(m_NavigationModeSelector = UISelectorFactory.createSelector <SetNavigationModeAction.NavigationMode>(NavigationContext.current, nameof(INavigationDataProvider.navigationMode),
                                                                                                                                   data =>
            {
                m_Button.transform.parent.gameObject.SetActive(m_ActiveDialogSelector?.GetValue() != OpenDialogAction.DialogType.LandingScreen &&
                                                               data != SetNavigationModeAction.NavigationMode.AR && data != SetNavigationModeAction.NavigationMode.VR);
            }));
        }
Esempio n. 8
0
 public string TimeOfDayQueryValue() => $"{TimeOfDaySelector.GetValue()}";
Esempio n. 9
0
 public string NorthAngleQueryValue() => $"{NorthAngleSelector.GetValue()}";
Esempio n. 10
0
 protected override bool IsSelected()
 {
     return(m_ActiveSubDialogGetter.GetValue() == OpenDialogAction.DialogType.Account);
 }
Esempio n. 11
0
 public string LongitudeQueryValue() => $"{LongitudeSelector.GetValue()}";
        void Update()
        {
            m_ZoomDelta.Reset();
            m_PanDelta.Reset();
            m_WorldOrbitDelta.Reset();
            m_InputSkipper++;

            if (Time.unscaledDeltaTime <= m_UINavigationControllerSettings.inputLagCutoffThreshold)
            {
                if (Time.unscaledDeltaTime <= m_UINavigationControllerSettings.inputLagSkipThreshold)
                {
                    if (!m_MovingAction.enabled)
                    {
                        m_MovingAction.Enable();
                    }
                }
                else
                {
                    if (m_MovingAction.enabled)
                    {
                        m_MovingAction.Disable();
                    }
                }

                if (!m_MoveEnabled)
                {
                    return;
                }

                var val = m_MovingAction.ReadValue <Vector3>();
                if (val != m_LastMovingAction)
                {
                    m_LastMovingAction = val;
                    m_Camera.MoveInLocalDirection(val, LookAtConstraint.Follow);
                }
            }
            else
            {
                m_MovingAction.Disable();
                m_Camera.ForceStop();
                m_LastMovingAction = Vector3.zero;
                m_Camera.MoveInLocalDirection(Vector3.zero, LookAtConstraint.Follow);
            }

            if (m_InfoTypeSelector.GetValue() == SetInfoTypeAction.InfoType.Debug &&
                m_GestureTrackingEnabledSelector.GetValue())
            {
                if (m_ZoomGestureInProgress)
                {
                    m_DebugButton.buttonRound.color = Color.red;
                    m_DebugButton.selected          = true;
                }
                else
                {
                    if (m_PanGestureInProgress)
                    {
                        m_DebugButton.buttonRound.color = Color.yellow;
                        m_DebugButton.selected          = true;
                    }
                    else
                    {
                        m_DebugButton.selected          = false;
                        m_DebugButton.buttonRound.color = m_DefaultColor;
                    }
                }
            }
        }
Esempio n. 13
0
        IEnumerator VisualizeWhenLoaded()
        {
            yield return(new WaitUntil(() => m_ProgressStateActionSelector.GetValue() == SetProgressStateAction.ProgressState.NoPendingRequest));

            m_MarkerController.Visualize(m_MarkerController.ActiveMarker);
        }
Esempio n. 14
0
        void UpdateHeight()
        {
            var availableSpace   = m_RectTransform.rect.height - m_ScrollViewParent.position.y / m_ScaleFactorGetter.GetValue();
            var size             = m_ScrollViewParent.sizeDelta;
            var contentSizeDelta = m_ScrollView.content.sizeDelta;

            size.y = contentSizeDelta.y > availableSpace ? availableSpace : contentSizeDelta.y;
            m_ScrollViewParent.sizeDelta = size;

            LayoutRebuilder.ForceRebuildLayoutImmediate(m_Container);
        }
Esempio n. 15
0
        void OnButtonClicked()
        {
            bool value = m_FlagSelector.GetValue();

            Dispatcher.Dispatch(ActionBase.From <CopyAllPropertiesAction>(new { stateFlag = !value, stateText = $"oldValue = {value}" }));
        }
Esempio n. 16
0
        void OnDialogButtonClick()
        {
            if (m_DialogType != OpenDialogAction.DialogType.None)
            {
                var activeDialog = m_IsSubDialog ? m_ActiveSubDialogSelector.GetValue() : m_ActiveDialogSelector.GetValue();
                var dialogType   = activeDialog != m_DialogType && openDialogCondition() ? m_DialogType : OpenDialogAction.DialogType.None;

                if (m_IsSubDialog)
                {
                    Dispatcher.Dispatch(OpenSubDialogAction.From(dialogType));
                }
                else
                {
                    Dispatcher.Dispatch(OpenDialogAction.From(dialogType));
                }

                if (!ReferenceEquals(m_Dialog, null) && m_MoveDialogToButton && dialogType != OpenDialogAction.DialogType.None)
                {
                    m_Dialog.transform.position = m_Button.transform.position;
                }
            }
        }
Esempio n. 17
0
 public string TimeOfYearQueryValue() => $"{TimeOfYearSelector.GetValue()}";
Esempio n. 18
0
 public string UtcOffsetQueryValue() => $"{UtcOffsetSelector.GetValue()}";
Esempio n. 19
0
 void UpdateButtonInteractable()
 {
     m_Button.interactable = (m_ToolBarEnabledGetter != null && m_IsPrivateModeGetter != null) &&
                             m_ToolBarEnabledGetter.GetValue() && m_Interactable &&
                             UIStateManager.current.IsNetworkConnected && !m_IsPrivateModeGetter.GetValue();
 }
        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));
            }
        }
Esempio n. 21
0
 static bool HasNoProjectsAvailable()
 {
     return((s_ProgressStateGetter == null || s_ProgressStateGetter == null) ||
            (s_ProgressStateGetter.GetValue() == SetProgressStateAction.ProgressState.NoPendingRequest && s_RoomsGetter.GetValue().Length == 0));
 }
Esempio n. 22
0
 static bool IsLoadingProjects()
 {
     return(s_ProgressStateGetter != null && s_RoomsGetter != null &&
            s_ProgressStateGetter?.GetValue() != SetProgressStateAction.ProgressState.NoPendingRequest && s_RoomsGetter.GetValue().Length == 0);
 }
 protected bool IsFollowing()
 {
     return(MatchmakerId != null && MatchmakerId == m_FollowUserIdSelector.GetValue());
 }
        public void Next()
        {
            if (!CurrentInstructionStep.CheckValidations(m_FirstSelectedPlaneGetter.GetValue(), m_SecondSelectedPlaneGetter.GetValue(), ((ObjectSelectionInfo)m_ObjectSelectionInfoGetter.GetValue()).CurrentSelectedObject()))
            {
                return;
            }

            var transition = m_States[++m_ViewBasedInstructionUI].onNext;

            if (transition != null)
            {
                transition();
            }
        }
        protected bool IsMuted()
        {
            var user = m_UsersSelector.GetValue().Find(data => data.matchmakerId == MatchmakerId);

            return(user.voiceStateData.isServerMuted);
        }
        void FixedUpdate()
        {
            OnNavigation();

            // always move along the camera forward as it is the direction that it being aimed at
            Vector3 desiredMove = transform.forward * m_Input.y + transform.right * m_Input.x;

            // get a normal for the surface that is being touched to move along it
            RaycastHit hitInfo;

            Physics.SphereCast(transform.position, m_CharacterController.radius, Vector3.down, out hitInfo,
                               m_CharacterController.height / 2f, Physics.AllLayers, QueryTriggerInteraction.Ignore);
            desiredMove = Vector3.ProjectOnPlane(desiredMove, hitInfo.normal).normalized;
            m_MoveDir.x = desiredMove.x * m_Speed;
            m_MoveDir.z = desiredMove.z * m_Speed;
            if (!GamingNavigation)
            {
                var offset = m_Input.y <= (-1f + Mathf.Epsilon) ? Quaternion.Euler(0, 180f, 0) : Quaternion.identity;

                if (m_Input != Vector2.zero)
                {
                    transform.rotation = Quaternion.Slerp(transform.rotation, Quaternion.LookRotation(desiredMove) * offset, m_RotationSpeed);
                }
            }

            RotateView();
            if (m_Rigidbody.useGravity)
            {
                if (m_CharacterController.isGrounded)
                {
                    m_MoveDir.y = -m_StickToGroundForce;

                    if (m_Jump)
                    {
                        m_MoveDir.y = m_JumpSpeed;
                        PlayJumpSound();
                        m_Jump    = false;
                        m_Jumping = true;
                    }
                }
                else
                {
                    m_MoveDir += Physics.gravity * m_GravityMultiplier * Time.fixedDeltaTime;
                }
            }
            else
            {
                m_MoveDir.y = 0;
            }

            if (m_CharacterController.enabled)
            {
                m_CollisionFlags = m_CharacterController.Move(m_MoveDir * Time.fixedDeltaTime);
            }
            ProgressStepCycle(m_Speed);
            UpdateCameraPosition(m_Speed);
            m_MouseLook.UpdateCursorLock();
            if (transform.position.y < m_MaxFallDistance)
            {
                m_WalkInstructionSelector.GetValue().Reset(m_ResetFallOffset);
            }
        }
Esempio n. 27
0
 bool IsConnected()
 {
     return(string.IsNullOrEmpty(m_ActiveProjectGetter.GetValue()?.projectId) ||
            !string.IsNullOrEmpty(((UserIdentity)m_UserIdentityGetter.GetValue()).matchmakerId));
 }