Cursor
Cursors
A scriptable object that contains a list of different cursors types.Asset can be created with the Context menu / Create / New UI Widgets / Cursors.UICursor
Static class, wrapper for the
Cursor.SetCursor()to avoid cursor conflicts between different widgets and components. For example :doc:/components/resizable` component should not change the cursor if currently controlled by the :doc:/components/drag-and-drop` component.CursorDPISelector
This component selects the most appropriateCursorsasset byScreen.dpifrom the available cursors list and sets it as default cursors (UICursor.Cursors).Components like Resizable have theCursorsfield, so they can have custom cursors to use instead of the default one.
Cursors Fields
Default
Cursors.CursorDefault cursor.
Allowed
Cursors.CursorCursor for the allowed actions.
Denied
Cursors.CursorCursor for the not allowed actions
NorthSouthArrow
Cursors.CursorNorth <-> South arrow.
EastWestArrow
Cursors.CursorEast <-> West arrow.
NorthEastSouthWestArrow
Cursors.CursorNorthEast <-> SouthWest arrow.
NorthWestSouthEastArrow
Cursors.CursorNorthWest <-> SouthEast arrow.
NorthWestRotateArrow
Cursors.CursorNorth <-> West arrow.
NorthEastRotateArrow
Cursors.CursorNorth <-> East arrow.
SouthWestRotateArrow
Cursors.CursorSouth <-> West arrow.
SouthEastRotateArrow
Cursors.CursorSouth <-> East arrow.
Cursors.Cursor Fields
Texture
Texture2DCursor texture.
Hotspot
Vector2Cursor hot spot.
UICursor Static Fields
Cursors
CursorsDifferent default cursors.
CanSet
Func<Component, bool>Is can the specified component set the cursor?trueif cursor does not have an owner or the owner is the same.Set
Action<Component, Cursors.Cursor>Set the cursor and current owner.The cursor will be changed only ifCanSet(owner)returnstrue.Reset
Action<Component>Reset cursor and its owner to the default.