Drag[en]gine Script Module DragonScript
1.23
|
Default implementation of ECAttachableBehavior doing nothing. More...
Public Member Functions | |
void | addToGameWorld () |
void | attachToParent (Element parent) |
void | dispose () |
void | enterFrame () |
void | geometryChanged () |
BehaviorElement | getElement () |
DefaultECAttachableBehavior | new () |
Create default attachable behavior instance. More... | |
void | onAddToElement () |
Behavior has been added to element. More... | |
void | onRemoveFromElement () |
Behavior has been removed from element. More... | |
String | persistencyFactoryName () |
void | postThink (float elapsed) |
void | removeFromGameWorld () |
bool | requiresEnterFrame () |
bool | requiresThink () |
void | safeDispose () |
Remove from element if present then call dispose(). More... | |
void | setElement (BehaviorElement element) |
void | stateChanged () |
void | think (float elapsed) |
void | writeObjectToFile (PersistencyEnvironment env, FileWriter writer) |
Public Attributes | |
BehaviorElement | pElement |
bool | pRequiresEnterFrame |
bool | pRequiresThink |
Protected Member Functions | |
void | setRequiresEnterFrame (bool required) |
Set if behavior instance requires enterFrame() to be called. More... | |
void | setRequiresThink (bool required) |
Set if behavior instance requires think() and postThink() to be called. More... | |
Default implementation of ECAttachableBehavior doing nothing.
The defaut implementation of persistencyFactoryName() returns null. BehaviorElement does not persist attachable behaviors returning null as persistency factory name.
If you want to persist the behavior implement a factory and overwrite persistencyFactoryName() returning the factory name. The writeObjectToFile() writes by default a 0 byte (version byte) to allow easy expansion in future revisions.
An example factor implementation looks like this:
You need then also an implementation of MyAttachableBehavior.new(PersistencyEnvironment env, FileReader reader) like this:
The default implementation of writeObjectToFile writes a single 0 value byte (version byte) to allow easy extension of the behavior in future revisions.
Also do not forget to add your factory to the game wide persistency factory list in BaseGameApp.registerPersistencyFactories() like this:
void Dragengine.Scenery.DefaultECAttachableBehavior.addToGameWorld | ( | ) |
Reimplemented in Dragengine.Debugging.DebugBehaviorVRHandPose.
void Dragengine.Scenery.DefaultECAttachableBehavior.attachToParent | ( | Element | parent | ) |
void Dragengine.Scenery.DefaultECAttachableBehavior.dispose | ( | ) |
void Dragengine.Scenery.DefaultECAttachableBehavior.enterFrame | ( | ) |
void Dragengine.Scenery.DefaultECAttachableBehavior.geometryChanged | ( | ) |
BehaviorElement Dragengine.Scenery.DefaultECAttachableBehavior.getElement | ( | ) |
DefaultECAttachableBehavior Dragengine.Scenery.DefaultECAttachableBehavior.new | ( | ) |
Create default attachable behavior instance.
void Dragengine.Scenery.DefaultECAttachableBehavior.onAddToElement | ( | ) |
Behavior has been added to element.
Called by setElement() after element has been set in these situations:
Reimplemented in Dragengine.Debugging.DebugBehaviorVRHandPose.
void Dragengine.Scenery.DefaultECAttachableBehavior.onRemoveFromElement | ( | ) |
Behavior has been removed from element.
Called by setElement() before element is set to null in these situations:
Reimplemented in Dragengine.Debugging.DebugBehaviorVRHandPose.
String Dragengine.Scenery.DefaultECAttachableBehavior.persistencyFactoryName | ( | ) |
void Dragengine.Scenery.DefaultECAttachableBehavior.postThink | ( | float | elapsed | ) |
Reimplemented in Dragengine.Debugging.DebugBehaviorVRHandPose.
void Dragengine.Scenery.DefaultECAttachableBehavior.removeFromGameWorld | ( | ) |
Reimplemented in Dragengine.Debugging.DebugBehaviorVRHandPose.
bool Dragengine.Scenery.DefaultECAttachableBehavior.requiresEnterFrame | ( | ) |
bool Dragengine.Scenery.DefaultECAttachableBehavior.requiresThink | ( | ) |
void Dragengine.Scenery.DefaultECAttachableBehavior.safeDispose | ( | ) |
Remove from element if present then call dispose().
Use this call to safely dispose of the attachable behavior.
void Dragengine.Scenery.DefaultECAttachableBehavior.setElement | ( | BehaviorElement | element | ) |
|
protected |
Set if behavior instance requires enterFrame() to be called.
|
protected |
Set if behavior instance requires think() and postThink() to be called.
void Dragengine.Scenery.DefaultECAttachableBehavior.stateChanged | ( | ) |
void Dragengine.Scenery.DefaultECAttachableBehavior.think | ( | float | elapsed | ) |
void Dragengine.Scenery.DefaultECAttachableBehavior.writeObjectToFile | ( | PersistencyEnvironment | env, |
FileWriter | writer | ||
) |
BehaviorElement Dragengine.Scenery.DefaultECAttachableBehavior.pElement |
bool Dragengine.Scenery.DefaultECAttachableBehavior.pRequiresEnterFrame |
bool Dragengine.Scenery.DefaultECAttachableBehavior.pRequiresThink |