|
| void | addListenerFactory (Block blockFactory) |
| | Add listener factory using block.
|
| |
| void | addListenerFactory (ListenerFactory factory) |
| | Add listener factory.
|
| |
| void | createListeners (Instance instance) |
| | Create listeners from factories adding them to behavior instance.
|
| |
| void | dispose () |
| | Dispose of behavior.
|
| |
| void | forEachListenerFactory (Block ablock) |
| | Visit listener factories with block with argument ListenerFactory.
|
| |
| ECComposeAttachResource | getAttach () |
| | Attach resource.
|
| |
| ECComposeBTSM | getBTSMs () |
| | Compose behavior trees and state machines.
|
| |
| ECBehaviorCollider | getCollider () |
| | Collider behavior or null to not attach.
|
| |
| ECComposeForceField | getForceField () |
| | Composeable force field for element class.
|
| |
| String | getPrefix () |
| | Prefix.
|
| |
| ECBehaviorForceField | getSyncTrigger () |
| | ECBehaviorForceField to synchronize triggers with or null to disable.
|
| |
| ECBehaviorTriggered | getTrigger () |
| | Trigger enable.
|
| |
| TSTriggerTable | getTriggerTable () |
| | Trigger table or null if not used.
|
| |
| ECBehaviorForceField | new (BehaviorElementClass eclass, ECBehaviorCollider collider) |
| | Create behavior element class.
|
| |
| ECBehaviorForceField | new (BehaviorElementClass eclass, ECBehaviorCollider collider, String id) |
| |
| ECBehaviorForceField | new (BehaviorElementClass eclass, ECBehaviorCollider collider, TSTriggerTable triggerTable) |
| |
| ECBehaviorForceField | new (BehaviorElementClass eclass, ECBehaviorCollider collider, TSTriggerTable triggerTable, String id) |
| |
| ECBehaviorForceField | new (BehaviorElementClass eclass, ECBehaviorCollider collider, TSTriggerTable triggerTable, String id, String subID) |
| |
| ECBehaviorForceField | new (BehaviorElementClass eclass, ECBehaviorCollider collider, TSTriggerTable triggerTable, String id, String subID, String prefix) |
| |
| void | setSyncTrigger (ECBehaviorForceField behavior) |
| | ECBehaviorForceField to synchronize triggers with or null to disable.
|
| |
| void | setTriggerTable (TSTriggerTable triggerTable) |
| | Set trigger table or null if not used.
|
| |
| void | assignInstanceIndex (int instanceIndex) |
| | Assign instance index.
|
| |
| String | getBehaviorID () |
| | Unique identifier of behavior.
|
| |
| String | getID () |
| | Identifier.
|
| |
| int | getInstanceIndex () |
| | Instance index.
|
| |
| void | loadSupportedData (String identifier, PersistencyEnvironment env, FileReader reader, ECBehaviorInstance instance) |
| | Load instance data of another behavior.
|
| |
| bool | supportsBehaviorID (String identifier) |
| | Behavior supports loading instance data of another behavior.
|
| |
| ECBehaviorInstance | createInstance (BehaviorElement element) |
| | Create Behavior instance.
|
| |
Behavior element behavior adding force field support.
Behavior adds a ForceField resource to the the behavior element. This behavior can be added multiple times to an element. Each instance creates one force field attached to the element collider which can be individually modified. To distinguish the force fields each instance has an identifier which can be used to retrieve a specific instance. The prefix of the force field class properties is "forceField." . If the identifier is not empty the force field element class properties have the prefix "{id}.forceField.". This can be overwritten if required. Hence to use more than one force field use code like this in your subclass constructor:
func new()
end
end
Behavior element element class.
Definition BehaviorElementClass.ds:54
Behavior element behavior adding force field support.
Definition ECBehaviorForceField.ds:101
You can now define the parameters to use for both force fields using for example the properties "color" for the first force field and "subForceField.color" for the second forceField.
It is recommended to always specify an identifier even if only one force field is used. This avoids potentially name conflicts especially if other behaviors are added attaching other resources too.
If the ECBehaviorCollider behavior is present in the behavior element before this behavior is added the force field is attached. The force field is attached to the named bone if defined otherwise it is attached statically.
Element class properties have the prefix "forceField{(id)}.".
- Listening and Customized ForceField Handling
The owner element class and other behaviors can register a listener to be notified if the force field is (de)enabled. This can be used to provide customized force field handling support for example flickering or dimmable force fields.
If another behaviors wants to control the force field parameters in response to these events it should call setCustomForceFieldHandling(true). In this case the behavior implementing the force field parameter handling has to use requiresThink() to think while the effect lasts.
- Owner Element Visibility
The enabled state of the force field is linked with the visibility state of the owner element. If the owner element becomes invisible the force field resource is always disabled. If the owner element becomes visible the force field resource is enabled if the behavior is enabled too.
If custom force field handling is used the behavior resposible for the custom force field handling is required to listen to stateChanged() calls and act accordingly. The force field resource will be always enabled no matter if the custom force field handling is enabled or not. Only if the behavior is (de)enabled or the element becomes visible the force field parameters are not modified if custom force field handling is enabled.
This behavior does support element class to be persistable (setPersistable).
- See also
- https://developer.dragondreams.ch/wiki/doku.php/dragengine:modules:dragonscript:behavior_forcefield