This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
dragengine:modules:dragonscript:behavior_animated [2025/03/12 14:43] – [ECBehaviorAnimated] dragonlord | dragengine:modules:dragonscript:behavior_animated [2025/03/13 17:10] (current) – dragonlord | ||
---|---|---|---|
Line 1: | Line 1: | ||
{{tag> | {{tag> | ||
<WRAP youarehere> | <WRAP youarehere> | ||
- | [[: | + | [[: |
</ | </ | ||
Line 108: | Line 108: | ||
A typical usage pattern for such behaviors is to locate the animator controller to update during construction time and to manipulated the controllers inside updateControllers(). | A typical usage pattern for such behaviors is to locate the animator controller to update during construction time and to manipulated the controllers inside updateControllers(). | ||
+ | |||
See [[# | See [[# | ||
Line 130: | Line 131: | ||
====== Required Behaviors ====== | ====== Required Behaviors ====== | ||
- | This behavior requires these other behaviors: | ||
* [[behavior_component|ECBehaviorComponent]] | * [[behavior_component|ECBehaviorComponent]] | ||
Line 163: | Line 163: | ||
component = ECBehaviorComponent.new(this, | component = ECBehaviorComponent.new(this, | ||
animated = ECBehaviorAnimated.new(this, | animated = ECBehaviorAnimated.new(this, | ||
+ | end | ||
+ | end | ||
+ | </ | ||
+ | |||
+ | Example of using listeners. | ||
+ | |||
+ | < | ||
+ | class MyListener extends ECBehaviorInstance.DefaultListener | ||
+ | var AnimatorController pController | ||
+ | | ||
+ | func new(ECBehaviorAnimated behavior) | ||
+ | pController = behavior.getAnimatorInstance().getControllerNamed(" | ||
+ | end | ||
+ | | ||
+ | func void updateControllers(Instance instance, float elapsed) | ||
+ | pController.increment(elapsed) | ||
end | end | ||
end | end |