Skip to content

InteractableObject

This InteractableObject struct contains a set of functions for dealing with interactable objects. Before you use this API, attach the yahaha.UI_Interact community component to the object.

Properties

YaEntity entity
InteractableObject's entity.
ScanMode scanMode
The scanMode which interactableObject is scanned.

E.g. in function Interactor.OnObjectEnter(callback<InteractableObject>), if interactor scans this interactableObject with ScanMode.PhysicsClient, the parameter interactableObject in callback<InteractableObject> 's scanMode will be ScanMode.PhysicsClient

Functions

void OnInteractorEnter(function callback<Interactor>)
Provides a callback that will be invoked when the interactor enters the interactive range.
void OnInteractorLeave(function callback<Interactor>)
Provides a callback that will be invoked when the interactor leaves the interactive range.
void OnInteractionStart(function callback<Interactor, number>)
Provides a callback that will be invoked when the interactable object starts being interacted with.
void OnInteractionStop(function callback<Interactor, number>)
Provides a callback that will be invoked when the interactable object stops being interacted with.
void SetEnable(boolean enable)
Set this interactable object is enable or not.
void SetEnable(boolean enable, number pointId)
Set specified interactable point on this interactable object with pointId to enable or not.