![]() |
Eye of the Nile Docs
Everything you need to know to get started!
|
This script goes on (as a component) the icons for the abilities on the ability hotbar and handles the drag and drop functionality.
Documentation updated 9/18/2024
Public Member Functions | |
void | OnBeginDrag (PointerEventData eventData) |
Runs when the user begins to drag the icon. Prevents further mouse input to prevent conflicts (raycastTarget), remembers the now previous parent slot, and removes the icon as a child of the icon it was under. | |
void | OnDrag (PointerEventData eventData) |
Runs every frame the user is dragging the icon. Sets the position of the icon to match the location of the cursor. | |
void | OnEndDrag (PointerEventData eventData) |
Runs when the user stops dragging the icon and drops it. Re-enables mouse inputs (raycastTarget) and sets itself as a child of it's next parent. | |
Public Attributes | |
Transform | previousParent |
The transform of the previous slot this icon was under. | |
Transform | nextParent |
The transform of the next slot this icon will be under. This will be set to the correct value by AbilitySlotUI when it's time to drop the icon. | |
Properties | |
BaseAbilityInfo | CurAbilityInfo [get, set] |
Reference the the ability info of the ability this icon represents. | |
Image | CurImage [get, set] |
Reference to the image used as the icon for the ability. | |
Private Member Functions | |
void | Awake () |
Set the reference to the image used as the icon for this ability. | |
|
private |
Set the reference to the image used as the icon for this ability.
void AbilityImageUI.OnBeginDrag | ( | PointerEventData | eventData | ) |
Runs when the user begins to drag the icon. Prevents further mouse input to prevent conflicts (raycastTarget), remembers the now previous parent slot, and removes the icon as a child of the icon it was under.
void AbilityImageUI.OnDrag | ( | PointerEventData | eventData | ) |
Runs every frame the user is dragging the icon. Sets the position of the icon to match the location of the cursor.
void AbilityImageUI.OnEndDrag | ( | PointerEventData | eventData | ) |
Runs when the user stops dragging the icon and drops it. Re-enables mouse inputs (raycastTarget) and sets itself as a child of it's next parent.
Transform AbilityImageUI.nextParent |
The transform of the next slot this icon will be under. This will be set to the correct value by AbilitySlotUI when it's time to drop the icon.
Transform AbilityImageUI.previousParent |
The transform of the previous slot this icon was under.
|
getset |
Reference the the ability info of the ability this icon represents.
|
getset |
Reference to the image used as the icon for the ability.