InteractableComponent
public final class InteractableComponent extends Component
Provides access to raw InputEvents for given Entity, so a client can implement their own interaction logic.
Summary
Public methods |
|
|---|---|
static final @NonNull InteractableComponent |
Public factory for creating an InteractableComponent. |
static final @NonNull InteractableComponent |
create(Public factory for creating an InteractableComponent. |
Protected methods |
|
|---|---|
boolean |
Attaches this component to the given |
void |
Detaches this component from the given |
Public methods
create
public static final @NonNull InteractableComponent create(
@NonNull Session session,
@NonNull Consumer<@NonNull InputEvent> inputEventListener
)
Public factory for creating an InteractableComponent. It enables access to raw input events.
| Parameters | |
|---|---|
@NonNull Session session |
|
@NonNull Consumer<@NonNull InputEvent> inputEventListener |
|
create
public static final @NonNull InteractableComponent create(
@NonNull Session session,
@NonNull Executor executor,
@NonNull Consumer<@NonNull InputEvent> inputEventListener
)
Public factory for creating an InteractableComponent. It enables access to raw input events.
Protected methods
onAttach
protected boolean onAttach(@NonNull Entity entity)
Attaches this component to the given Entity. When attached, the component begins listening for InputEvents on this Entity, and any descendant Entitys in its subgraph that do not have a InteractableComponent attached to themselves.
| Returns | |
|---|---|
boolean |
|