예제 #1
0
        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);
        }