UIAxisEventListener
Receives axis value updates from UI controls like joysticks and driving wheel.
Create in the Editor
- Ensure there is a
UIControllerin the scene. - Create a GameObject and add
UIRect. - Add the
UIAxisEventListenercomponent.
How to Use
- Get the component with
myObject.findComponent(UIAxisEventListener.class). - Read and write the component properties to control behavior.
- Test input or layout in Play mode.
Java Example
SpatialObject myObject = /* your object */;
UIAxisEventListener comp = myObject.findComponent(UIAxisEventListener.class);
if (comp != null) {
// set the axisName value:
comp.axisName = "value";
// read the axisName value:
String axisNameValue = comp.axisName;
// set the value value:
comp.value = new Vector2(1, 1);
// read the value value:
Vector2 valueValue = comp.value;
}