ParaScript.OnUIPointerDown

Declaration

public void OnUIPointerDown(UIType ui, HandType hand)

Parameters

Parameter NameParameter Description
uiType of the button pressed by the player
handScreen area where the button pressed by the player is located

Description

Triggered when the UI button or joystick is being pressed.

The OnUIPointerDown, OnUIPointerUp, OnUIPointerClick, and OnUILongPress events are generally used with the ParaInteractiveObject or ParaPickup script.

When an object is mounted with the ParaInteractiveObject script:

  • If you set the ButtonPostion property of the script to InteractiveButtonType.Hand, when a player enters the interaction range of the object, a main interaction button will be displayed next to all the hands that do not hold the object on the screen. When the player interacts with the button, UIType.Pickup will be passed in by the ui parameter of the triggered event.
  • If you set the ButtonPostion property of the script to InteractiveButtonType.Additive, when a player enters the interaction range of the object, an assist button will be displayed on the right of the screen. When the player interacts with the button, UIType.Assist will be passed in by the ui parameter of the triggered event.
    As the object only shows the interaction button on the right in this mode, the hand parameter of the triggered event is invalid.

When an object is mounted with the ParaPickup script:

  • When the player enters the interaction range of the object:
    • A hand button for picking up the object will be displayed next to all the hands that hold no pickup object on the screen. When the player interacts with the button, UIType.Pickup will be passed in by the ui parameter of the triggered event.
  • When the player holds the object:
    • If the MainButtonType property of the script is MainInteractButtonType.Button, a main interaction button will be displayed on the side of the held object on the screen. When the player interacts with the button, UIType.Main will be passed in by the ui parameter of the triggered event.
    • If the MainButtonType property of the script is MainInteractButtonType.Stick, a joystick will be displayed on the side of the held object on the screen. When the player interacts with the joystick, UIType.Main will be passed in by the ui parameter of the triggered event.
    • If the FirstSubButton/SecondSubButton property of the script is true, the first or second sub button will be displayed on the side of the held object on the screen. When the player interacts with the button, UIType.SubFirst/UIType.SubSecond will be passed in by the ui parameter of the triggered event.
    • The button for dropping objects will be displayed on the side of the held object on the screen. When the player interacts with the button, UIType.Throw will be passed in by the ui parameter of the triggered event.

If the button or joystick the player is interacting with is on the left side of the screen, HandType.Left will be passed in by the hand parameter of the triggered event. Otherwise, HandType.Right will be passed in by the hand parameter of the triggered event.