版本:Unity 6 (6000.0)
语言中文(简体)
  • C#

MouseCursor.SplitResizeUpDown

建议更改

成功!

感謝您協助我們改善 Unity 文件的品質。雖然我們無法接受所有提交的文件,但我們會閱讀使用者建議的每項更改並在適用時進行更新。

關閉

提交失敗

由於某些原因,無法提交您建議的更改。請在幾分鐘後再<a>重試</a>。感謝您花時間協助我們改善 Unity 文件的品質。

關閉

取消

說明

用於窗格分隔器的上下調整大小的箭頭。

//Create a folder and name it “Editor” if this doesn’t already exist
//Put this script in the folder

//This script creates a new menu (“Examples”) and a menu item (“Mouse Cursor”). Click on this option. This displays a small window that has a color box in it. //Hover over the colored box to cause a SplitResizeUpDown mouse cursor to appear.

using UnityEngine; using UnityEditor;

public class MouseCursorExample : EditorWindow { [MenuItem("Examples/MouseCursorRect Example")] static void AddCursorRectExample() { MouseCursorExample window = EditorWindow.GetWindowWithRect<MouseCursorExample>(new Rect(0, 0, 180, 80)); window.Show(); }

void OnGUI() { EditorGUI.DrawRect(new Rect(10, 10, 160, 60), new Color(0.5f, 0.5f, 0.85f)); EditorGUI.DrawRect(new Rect(20, 20, 140, 40), new Color(0.9f, 0.9f, 0.9f)); EditorGUIUtility.AddCursorRect(new Rect(20, 20, 140, 40), MouseCursor.SplitResizeUpDown); } }