Esempio n. 1
0
        void Orbit(Vector2 delta)
        {
            var data = UIStateManager.current.stateData;

            switch (data.toolState.orbitType)
            {
            case OrbitType.WorldOrbit:
                m_Camera.Rotate(new Vector2(delta.y, delta.x));
                break;

            case OrbitType.OrbitAtPoint:
                m_Camera.OrbitAroundLookAt(new Vector2(delta.y, delta.x));
                break;

            default:
                throw new ArgumentOutOfRangeException();
            }

            if (m_CachedCameraOptionData?.cameraViewType != CameraViewType.Default)
            {
                data.cameraOptionData.cameraViewType = CameraViewType.Default;
                Dispatcher.Dispatch(Payload <ActionTypes> .From(ActionTypes.SetCameraOption, data.cameraOptionData));
            }
            OnInteraction();
        }
Esempio n. 2
0
        void Orbit(Vector2 delta)
        {
            var data = UIStateManager.current.stateData;

            switch (data.toolState.orbitType)
            {
            case OrbitType.WorldOrbit:
                m_Camera.Rotate(new Vector2(delta.y, delta.x));
                break;

            case OrbitType.OrbitAtPoint:
                m_Camera.OrbitAroundLookAt(new Vector2(delta.y, delta.x));
                break;

            default:
                throw new ArgumentOutOfRangeException();
            }
        }
        void Orbit(Vector2 delta, SetOrbitTypeAction.OrbitType orbitType)
        {
            switch (orbitType)
            {
            case SetOrbitTypeAction.OrbitType.WorldOrbit:
                m_Camera.Rotate(new Vector2(delta.y, delta.x));
                break;

            case SetOrbitTypeAction.OrbitType.OrbitAtPoint:
                m_Camera.OrbitAroundLookAt(new Vector2(delta.y, delta.x));
                break;

            default:
                throw new ArgumentOutOfRangeException();
            }

            if (m_CameraViewSelector.GetValue() != null && m_CameraViewSelector.GetValue().cameraViewType != SetCameraViewTypeAction.CameraViewType.Default)
            {
                Dispatcher.Dispatch(SetCameraViewTypeAction.From(SetCameraViewTypeAction.CameraViewType.Default));
            }

            OnInteraction();
        }