IBehaviorInstance script interface
IBehaviorInstance interface represents a behavior on an IInstance.
Many behaviors return a more specific class deriving from IBehaviorInstance to add APIs specific to the behavior. See the Behavior instances reference for more information.
- addEventListener(type, func, capture)
- removeEventListener(type, func, capture)
- Add or remove an event handler for a particular type of event fired by an addon's script interface. For information on which events are fired by specific addons, see the documentation on each addon's script interfaces.
- Dispatch an event, firing any handler functions that have been added for the event type. You can use
new C3.Event(eventName, isCancellable) to create an event object that can be dispatched (e.g.
new C3.Event("arrived", true)), and add any extra properties relevant to your event to that object. This can also be used by the addon SDK to cause your addon to fire an event in the script interface, e.g.:
const e = new C3.Event("arrived", true);
- A reference to the IInstance representing the object instance this behavior instance is affecting.
- A reference to the IBehavior representing the kind of behavior, e.g. Solid or Physics.
- A reference back to the IRuntime interface.
Construct 3 Manual
You are here:
Search this manual:
This manual entry was last updated on 2 Sep, 2020 at 16:41