SnapToGuides() public method

public SnapToGuides ( float value, float snapDistance ) : float
value float
snapDistance float
return float
        internal static float SnapToGuides(float value, float snapDistance, int axis)
        {
            if (EditorGUI.actionKey)
            {
                return(value);
            }
            SnapGuideCollection snapGuideCollection = (axis != 0) ? RectTransformSnapping.s_SnapGuides[1] : RectTransformSnapping.s_SnapGuides[0];

            return(snapGuideCollection.SnapToGuides(value, snapDistance));
        }
示例#2
0
        internal static float SnapToGuides(float value, float snapDistance, int axis)
        {
            if (EditorGUI.actionKey)
            {
                return(value);
            }
            SnapGuideCollection guides = (axis != 0) ? s_SnapGuides[1] : s_SnapGuides[0];

            return(guides.SnapToGuides(value, snapDistance));
        }
        internal static float SnapToGuides(float value, float snapDistance, int axis)
        {
            float result;

            if (EditorGUI.actionKey)
            {
                result = value;
            }
            else
            {
                SnapGuideCollection snapGuideCollection = (axis != 0) ? RectTransformSnapping.s_SnapGuides[1] : RectTransformSnapping.s_SnapGuides[0];
                result = snapGuideCollection.SnapToGuides(value, snapDistance);
            }
            return(result);
        }