What is Incisor?
Tutorials
Key Concepts
Reddit
Stack Overflow
Configuration Settings
Deprecation Schedule

CustomAddOn_Construct(owner)

CustomAddOns are objects containing modular user-defined functionality that can be added to different types of SceneObjects in the GUI. The type of the particular CustomAddOn determines what type of SceneObject it can be added to. For example, a CustomAddOn_SceneObject can be added to all objects that inherit from SceneObject, while a CustomAddOn_Button can only be added to objects that inherit from Button. To make a CustomAddOn available in the Incisor inspector build a class that extends one of the CustomAddOn types within a 'codeAsset' file, then call 'nc.registerCustomAddOn' in a 'runBeforeInit' block to register the new CustomAddOn type with the GUI. Once a CustomAddOn is added to another object, it can be found in that object's 'customAddOns' member, which is a dicitonary of CustomAddOns. [NON-INSTANTIABLE]

new CustomAddOn_Construct(owner)

CustomAddOns are objects containing modular user-defined functionality that can be added to different types of SceneObjects in the GUI. The type of the particular CustomAddOn determines what type of SceneObject it can be added to. For example, a CustomAddOn_SceneObject can be added to all objects that inherit from SceneObject, while a CustomAddOn_Button can only be added to objects that inherit from Button. To make a CustomAddOn available in the Incisor inspector build a class that extends one of the CustomAddOn types within a 'codeAsset' file, then call 'nc.registerCustomAddOn' in a 'runBeforeInit' block to register the new CustomAddOn type with the GUI. Once a CustomAddOn is added to another object, it can be found in that object's 'customAddOns' member, which is a dicitonary of CustomAddOns. [NON-INSTANTIABLE]

Parameters:
Name Type Attributes Default Description
owner Construct    

The object that this CustomAddOn will be added to upon instantiation.

MEMBERS

inheritedTypes :object

Dictionary object listing all of the types this object is compatible with.

name :string

The name of the CustomAddOn - this will automatically be set to match the name of the class definition.

owner :Construct

The owner of this CustomAddOn. This is the object that this CustomAddOn is meant to add its functionality to.

type :string

Type identifier.

METHODS

addDisposalCallback(callbackOwner, callbackName, callbackArgs (opt))

Adds a callback for when this CustomAddOn is disposed. It should be noted that this CustomAddOn will be automatically disposed if the owning object is disposed.

Parameters:
Name Type Attributes Default Description
callbackOwner object  

The object owning the callback that occurs when this CustomAddOn is disposed.

callbackName string  

The name of the callback that occurs when this CustomAddOn is disposed.

callbackArgs Array | any <optional>
 

Parameters for this callback.

dispose()

Removes this CustomAddOn from its owner and performs any registered disposal callbacks. It should be noted that this CustomAddOn will be automatically disposed if the owning object is disposed.

removeDisposalCallback(callbackOwner, callbackName)

Removes a callback for when this CustomAddOn is disposed.

Parameters:
Name Type Attributes Default Description
callbackOwner object    

The object owning the callback to be removed.

callbackName string    

The name of the callback to be removed.