Exemplo n.º 1
0
        public void SetCursor(Cursor cursor)
        {
            if (GUIView.current == null)
            {
                // Cannot set the cursor if the current view is null.
                return;
            }

            if (cursor.texture != null)
            {
                EditorGUIUtility.SetCurrentViewCursor(cursor.texture, cursor.hotspot, MouseCursor.CustomCursor);
            }
            else
            {
                var mouseCursor = (MouseCursor)cursor.defaultCursorId;
                if (mouseCursor == MouseCursor.Arrow)
                {
                    // If it's the default cursor reset the cursor state
                    // so that editor cursor rects can be processed
                    EditorGUIUtility.ClearCurrentViewCursor();
                }
                else
                {
                    EditorGUIUtility.SetCurrentViewCursor(null, Vector2.zero, mouseCursor);
                }
            }
        }
Exemplo n.º 2
0
 public void ResetCursor()
 {
     if (GUIView.current == null)
     {
         // Cannot clear the cursor if the current view is null.
         return;
     }
     EditorGUIUtility.ClearCurrentViewCursor();
 }
        public static void ClearCursor()
        {
            if (!s_CurrentCursor.HasValue)
            {
                return;
            }

            EditorGUIUtility.ClearCurrentViewCursor();
            s_CurrentCursor = null;
        }
Exemplo n.º 4
0
 public void ResetCursor()
 {
     EditorGUIUtility.ClearCurrentViewCursor();
 }