new Plugin(viewer, engine, config, index)
A plugin object is an instance of a FORGE.PluginEngine on top of the viewer.
It can be visual (display a logo) or not (gyroscope, stats ...).
It can be visual (display a logo) or not (gyroscope, stats ...).
Parameters:
Name | Type | Description |
---|---|---|
viewer |
FORGE.Viewer | FORGE.Viewer reference. |
engine |
FORGE.PluginEngine | The engine used to instantiate tis plugin. |
config |
PluginInstanceConfig | The config of the plugin instance. |
index |
number | The index of the plugin, use for display order. |
- Source:
- To Do:
-
- Scene array upgrade : Have a scene array with inclusive and exclusive uids
- Same filter array for groups ?
Extends
Members
(readonly) alive :boolean
Get the alive flag value of the object.
Type:
- boolean
- Inherited From:
- Source:
(readonly) className :string
Get the class name of the object.
Type:
- string
- Inherited From:
- Source:
(readonly) config :Object
Get the final merged config.
Type:
- Object
- Source:
data :*
Get and set any custom data you want to associate to this object.
Type:
- *
- Inherited From:
- Source:
debug :boolean
Get and set the debug flag.
Type:
- boolean
- Inherited From:
- Source:
(readonly) instance :Object
Get the plugin instance.
Type:
- Object
- Source:
(readonly) instanceConfig. :Object
Get the instance config.
Type:
- Object
- Source:
(readonly) instanceReady :boolean
Get the plugin instance ready flag.
Type:
- boolean
- Source:
(readonly) onDestroy :FORGE.EventDispatcher
Get the onDestroy FORGE.EventDispatcher, this event is emitted at the end of the destroy sequence.
Type:
- Inherited From:
- Source:
(readonly) onInstanceCreate :FORGE.EventDispatcher
Get the "onInstanceCreate" FORGE.EventDispatcher of the Plugin.
Type:
- Source:
(readonly) onInstanceReady :FORGE.EventDispatcher
Get the "onInstanceReady" FORGE.EventDispatcher of the Plugin.
Type:
- Source:
(readonly) reset :boolean
Get the plugin reset flag.
Type:
- boolean
- Source:
(readonly) scenes :Array
Get the scenes array. This plugin will be alive only on these scenes.
Type:
- Array
- Source:
(readonly) tags :Array
Get the tags associated to this object.
Type:
- Array
- Inherited From:
- Source:
(readonly) uid :string
Get the uid of the object.
Type:
- string
- Inherited From:
- Source:
warning :boolean
Get and set the warning flag.
Type:
- boolean
- Inherited From:
- Source:
Methods
(static) notifyInstanceReady()
Instance can notify with this method that the instance is ready
- Source:
destroy()
Destroy method.
- Overrides:
- Source:
instantiate()
Instantiate the plugin engine if it is loaded, if not listen to the engine load complete to retry to instantiate.
- Source:
log(value)
Basic log method, log a string in the console if debug is enabled.
Parameters:
Name | Type | Description |
---|---|---|
value |
* | The value you want to log in the console. |
- Inherited From:
- Source:
reset()
Reset the plugin to a specified configuration.
- Source:
update()
Update method called by the plugin manager.
- Source:
warn(valuenullable)
Basic warn method, log a warn string in the console if warning is enabled.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
value |
string | Object |
<nullable> |
The value you want to warn in the console. |
- Inherited From:
- Source: