private Vector3 SnapPoint(Vector3 position)
        {
            var np0screen     = m_SplineEditor.WorldToScreen(position);
            var snappedScreen = m_SplineEditor.WorldToScreen(SnappingUtility.Snap(position));

            var snapDistance = (np0screen - snappedScreen).magnitude;

            if (snapDistance < 15f)
            {
                position = SnappingUtility.Snap(position);
            }
            return(position);
        }
Exemple #2
0
        private Vector3 SnapPoint(Vector3 position)
        {
            Vector2 np0screen     = m_ShapeEditor.WorldToScreen(position);
            Vector2 snappedScreen = m_ShapeEditor.WorldToScreen(SnappingUtility.Snap(position));

            float snapDistance = (np0screen - snappedScreen).magnitude;

            if (snapDistance < 15f)
            {
                position = SnappingUtility.Snap(position);
            }
            return(position);
        }