Class Cursor
Represents the cursor in the inventory pane. The player uses the arrow keys to move the cursor around to select an InventoryElement
Namespace: WeaverCore.Inventory
Assembly: WeaverCore.dll
Syntax
public abstract class Cursor : MonoBehaviour
Properties
| Edit this page View SourceCursorPosition
The current position of the cursor
Declaration
public abstract Vector3 CursorPosition { get; }
Property Value
| Type | Description |
|---|---|
| Vector3 |
DefaultCursorPrefab
The default cursor prefab to use
Declaration
public static Cursor DefaultCursorPrefab { get; }
Property Value
| Type | Description |
|---|---|
| Cursor |
HighlightedElement
The element the cursor is currently highlighting
Declaration
public InventoryElement HighlightedElement { get; }
Property Value
| Type | Description |
|---|---|
| InventoryElement |
Panel
The pane this Cursor is a part of
Declaration
public InventoryPanel Panel { get; }
Property Value
| Type | Description |
|---|---|
| InventoryPanel |
Methods
| Edit this page View SourceBegin(InventoryPanel, InventoryElement)
Starts up the cursor
Declaration
public void Begin(InventoryPanel panel, InventoryElement beginElement)
Parameters
| Type | Name | Description |
|---|---|---|
| InventoryPanel | panel | The pane this cursor is a part of |
| InventoryElement | beginElement | The element the cursor should start on |
CanMove()
Can the cursor be moved to a new element?
Declaration
public virtual bool CanMove()
Returns
| Type | Description |
|---|---|
| bool |
End()
Ends the cursor
Declaration
public void End()
Hide()
Makes the cursor invisible
Declaration
public void Hide()
MoveTo(InventoryElement)
Moves the cursor to a new element
Declaration
public void MoveTo(InventoryElement element)
Parameters
| Type | Name | Description |
|---|---|---|
| InventoryElement | element | The new element the cursor should highlight |
OnBegin(InventoryElement)
Called when the inventory pane is opened
Declaration
protected abstract void OnBegin(InventoryElement beginElement)
Parameters
| Type | Name | Description |
|---|---|---|
| InventoryElement | beginElement | The element the cursor should start on |
OnEnd()
Called when the inventory pane is closed
Declaration
protected abstract void OnEnd()
OnHide()
Called when the cursor is to become invisible
Declaration
protected abstract void OnHide()
OnMoveTo(InventoryElement)
Called when the cursor is to move to a new InventoryElement
Declaration
protected abstract void OnMoveTo(InventoryElement element)
Parameters
| Type | Name | Description |
|---|---|---|
| InventoryElement | element | The new inventory element to move to |
OnShow()
Called when the cursor is to become visible
Declaration
protected abstract void OnShow()
Show()
Makes the cursor visible
Declaration
public void Show()