interface MAGES::Interaction::IUIInteractor

Overview

An interactor that can interact with UI elements. More…

interface IUIInteractor
{
    // properties

    int PointerId;
    Transform Transform;
    bool AllowUIInteraction;
    bool IsPointerOverGameObject;
    UnityEvent RegisterEnter;
    UnityEvent DeregisterEnter;

    // methods

    TrackedDeviceModel TryGetUIModel();
    PointerEventData TryGetLastPointerEventData();
    void UpdateUIModel(TrackedDeviceModel model);
    bool RegisterToEventSystem();
    void DeregisterFromEventSystem();
};

// direct descendants

class BaseUIInteractor;

Detailed Documentation

An interactor that can interact with UI elements.

Properties

int PointerId

Gets the pointer ID of the interactor, if it has one. Otherwise a value smaller than 0.

Transform Transform

Gets the transform from which the Raycast/Sphere for UIs originates.

bool AllowUIInteraction

Gets or sets a value indicating whether the interactor is in a state where it can interact with UIs.

bool IsPointerOverGameObject

Gets a value indicating whether the interactor is currently hovering over a gameobject.

UnityEvent RegisterEnter

Gets or sets the event invoked when the interactor registers with an event system.

UnityEvent DeregisterEnter

Gets or sets the event invoked when the interactor deregisters from an event system.

Methods

TrackedDeviceModel TryGetUIModel()

Try to get the UI model for the current interactor.

Returns:

The UI Model if exists.

PointerEventData TryGetLastPointerEventData()

Try to get the last pointer event data for the current interactor.

Returns:

The last pointer event data, if it exists.

void UpdateUIModel(TrackedDeviceModel model)

Updates the UI model with the current state of the interactor.

Parameters:

model

The model to fill with the current state of the IUIInteractor.

bool RegisterToEventSystem()

Tries to register the interactor with the current event system.

Returns:

True if the interactor was successfully registered.

void DeregisterFromEventSystem()

Deregisters the interactor from the current event system.