UITouchTrigger
Low-level touch listener that exposes pressed/down/up states for custom UI logic.
Create in the Editor
- Ensure there is a
UIControllerin the scene. - Create a GameObject and add
UIRect. - Add the
UITouchTriggercomponent.
How to Use
- Get the component with
myObject.findComponent(UITouchTrigger.class). - Read and write the component properties to control behavior.
- Test input or layout in Play mode.
Java Example
SpatialObject myObject = /* your object */;
UITouchTrigger comp = myObject.findComponent(UITouchTrigger.class);
if (comp != null) {
// read the selectedTouch value:
Touch selectedTouchValue = comp.selectedTouch;
}