GetScaleCursor() 개인적인 정적인 메소드

private static GetScaleCursor ( Vector2 direction ) : MouseCursor
direction Vector2
리턴 MouseCursor
예제 #1
0
        private static void HandleDirectionalCursor(Vector3 handlePosition, Vector3 handlePlaneNormal, Vector3 direction)
        {
            Vector2 mousePosition = Event.current.mousePosition;
            Plane   plane         = new Plane(handlePlaneNormal, handlePosition);
            Vector3 worldPos;

            if (RectHandles.RaycastGUIPointToWorldHit(mousePosition, plane, out worldPos))
            {
                Vector2 direction2 = RectHandles.WorldToScreenSpaceDir(worldPos, direction);
                Rect    position   = new Rect(mousePosition.x - 100f, mousePosition.y - 100f, 200f, 200f);
                EditorGUIUtility.AddCursorRect(position, RectHandles.GetScaleCursor(direction2));
            }
        }
예제 #2
0
        private static void HandleDirectionalCursor(Vector3 handlePosition, Vector3 handlePlaneNormal, Vector3 direction)
        {
            Vector2 mousePosition = Event.current.mousePosition;
            Plane   plane         = new Plane(handlePlaneNormal, handlePosition);
            Vector3 hit;

            if (!RectHandles.RaycastGUIPointToWorldHit(mousePosition, plane, out hit))
            {
                return;
            }
            Vector2 screenSpaceDir = RectHandles.WorldToScreenSpaceDir(hit, direction);

            EditorGUIUtility.AddCursorRect(new Rect(mousePosition.x - 100f, mousePosition.y - 100f, 200f, 200f), RectHandles.GetScaleCursor(screenSpaceDir));
        }