void OnMoveEnabledChanged(bool data)
        {
            m_TouchOrbitTypeSelector?.Dispose();
            m_DeviceCapabilitySelector?.Dispose();
            m_MoveEnabled = data;

            if (m_MovingAction != null)
            {
                if (data)
                {
                    m_MovingAction.Enable();
                }
                else
                {
                    m_MovingAction.Disable();
                    m_Camera.ForceStop();
                    m_LastMovingAction = Vector3.zero;
                    m_Camera.MoveInLocalDirection(Vector3.zero, LookAtConstraint.Follow);
                }
                m_TouchOrbitTypeSelector   = UISelectorFactory.createSelector <SetOrbitTypeAction.OrbitType>(SceneOptionContext.current, nameof(ISceneOptionData <SkyboxData> .touchOrbitType), OnTouchOrbitTypeChanged);
                m_DeviceCapabilitySelector = UISelectorFactory.createSelector <SetVREnableAction.DeviceCapability>(PipelineContext.current, nameof(IPipelineDataProvider.deviceCapability), OnDeviceCapabilityChanged);
            }
            m_NavigationModeSelector = UISelectorFactory.createSelector <SetNavigationModeAction.NavigationMode>(NavigationContext.current, nameof(INavigationDataProvider.navigationMode));
        }
Exemple #2
0
        void Update()
        {
            IsBlockedByUI();
            m_ZoomDelta.Reset();
            m_PanDelta.Reset();
            m_WorldOrbitDelta.Reset();
            m_InputSkipper++;

            if (Time.unscaledDeltaTime <= m_UINavigationControllerSettings.inputLagCutoffThreshold)
            {
                var val = m_MovingAction.ReadValue <Vector3>();
                if (val != m_LastMovingAction)
                {
                    m_LastMovingAction = val;
                    m_Camera.MoveInLocalDirection(val, LookAtConstraint.Follow);
                }
                if (Time.unscaledDeltaTime <= m_UINavigationControllerSettings.inputLagSkipThreshold)
                {
                    if (!m_MovingAction.enabled)
                    {
                        m_MovingAction.Enable();
                    }
                }
                else
                {
                    if (m_MovingAction.enabled)
                    {
                        m_MovingAction.Disable();
                    }
                }
            }
            else
            {
                m_MovingAction.Disable();
                m_Camera.ForceStop();
                m_LastMovingAction = Vector3.zero;
                m_Camera.MoveInLocalDirection(Vector3.zero, LookAtConstraint.Follow);
            }
        }
Exemple #3
0
        void Update()
        {
            m_ZoomDelta.Reset();
            m_PanDelta.Reset();
            m_WorldOrbitDelta.Reset();
            m_InputSkipper++;

            if (Time.unscaledDeltaTime <= m_UINavigationControllerSettings.inputLagCutoffThreshold)
            {
                var val = m_MovingAction.ReadValue <Vector3>();
                if (val != m_LastMovingAction)
                {
                    m_LastMovingAction = val;
                    m_Camera.MoveInLocalDirection(val, LookAtConstraint.Follow);
                }

                if (Time.unscaledDeltaTime <= m_UINavigationControllerSettings.inputLagSkipThreshold)
                {
                    if (!m_MovingAction.enabled)
                    {
                        m_MovingAction.Enable();
                    }
                }
                else
                {
                    if (m_MovingAction.enabled)
                    {
                        m_MovingAction.Disable();
                    }
                }
            }
            else
            {
                m_MovingAction.Disable();
                m_Camera.ForceStop();
                m_LastMovingAction = Vector3.zero;
                m_Camera.MoveInLocalDirection(Vector3.zero, LookAtConstraint.Follow);
            }

            if (m_CachedInfoType != null && m_CachedInfoType == InfoType.Debug &&
                m_CachedDebugOptions != null && m_CachedDebugOptions.Value.gesturesTrackingEnabled)
            {
                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;
                    }
                }
            }
        }