Binds scripts to Events and executes them when triggered. Any script can access the ScriptComponent executing them through the variable script. See also: Scripting Overview, Script Events Guide.

// Bind a function to the MouthOpened event
function onMouthOpen(eventData)
{
print("mouth was opened");
}
var event = script.createEvent("MouthOpenedEvent");
event.bind(onMouthOpen);

Hierarchy (view full)

Constructors

Properties

_offIcon: SceneObject
_onIcon: SceneObject
api: Record<string, any>
editEventCallbacks: boolean = false
enabled: boolean

If disabled, the Component will stop enacting its behavior.

name: string
onStateChanged: PublicApi<boolean> = ...
sceneObject: SceneObject
uniqueIdentifier: string
updatePriority: number

Accessors

  • get isToggledOn(): boolean
  • Returns boolean

    the current toggle state of the button

  • set isToggledOn(toggleOn): void
  • Parameters

    • toggleOn: boolean

      the new state of the button, invoking the toggle event if different than current state.

    Returns void

  • get offIcon(): SceneObject
  • Returns SceneObject

    the icon to be shown when the button is toggled off

  • set offIcon(iconObject): void
  • Parameters

    • iconObject: SceneObject

      the icon to be shown when the button is toggled off

    Returns void

  • get onIcon(): SceneObject
  • Returns SceneObject

    the icon to be shown when the button is toggled on

  • set onIcon(iconObject): void
  • Parameters

    • iconObject: SceneObject

      the icon to be shown when the button is toggled on

    Returns void

Methods

  • Returns true if the object matches or derives from the passed in type.

    Parameters

    • type: string

    Returns boolean

  • Returns true if this object is the same as other. Useful for checking if two references point to the same thing.

    Parameters

    Returns boolean

  • Returns void

  • Toggles the state of the button

    Returns void