Declaration
public void OnUIDrag(UIType ui, HandType hand, Vector2 pointer, Vector2 deltaPointer)
Parameters
Parameter Name | Parameter Description | |
---|---|---|
ui | Type of the joystick dragged by the player. Generally, UIType.Main | will always be passed in. |
hand | Screen area where the button dragged by the player is located | |
pointer | Position of the joystick. When the joystick is at the central point, (0, 0) is returned. The value range for both the horizontal and vertical axes is from -1 to 1. | |
deltaPointer | Position delta of the joystick |
Description
Triggered when the UI joystick is being pressed and dragged. Generally, this event is used with the ParaPickup script.
If an object is mounted with the ParaPickup script and the MainButtonType property of the script is set to MainInteractButtonType.Stick, when a player holds the object, the joystick will appear on the screen on the side of the held object. If the player presses and drags the joystick, this event will be triggered and UIType.Main will be passed in by the ui parameter.
If the joystick dragged by the player is on the left side of the screen, HandType.Left will be passed in by the hand parameter of the event. Otherwise, HandType.Right will be passed in by the hand parameter.