This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revision | Next revisionBoth sides next revision | ||
dragengine:modules:dragonscript:behavior_outline [2020/05/24 13:11] – dragonlord | dragengine:modules:dragonscript:behavior_outline [2020/05/24 14:06] – dragonlord | ||
---|---|---|---|
Line 52: | Line 52: | ||
Multiple instances of ECBehaviorOutline can be used for example to create different outlines to switch on and off or to add multiple outline skins to a single ECBehaviorComponent. Keep in mind though that each instance of ECBehaviorOutline creates a new component and dynamic skin resource which can impact performance if the used model has high polygon count. To use multiple instances use code like this in your subclass constructor: | Multiple instances of ECBehaviorOutline can be used for example to create different outlines to switch on and off or to add multiple outline skins to a single ECBehaviorComponent. Keep in mind though that each instance of ECBehaviorOutline creates a new component and dynamic skin resource which can impact performance if the used model has high polygon count. To use multiple instances use code like this in your subclass constructor: | ||
< | < | ||
- | class MyElement | + | class MultiInstanceClass |
public var ECBehaviorComponent component | public var ECBehaviorComponent component | ||
public var ECBehaviorCollider collider | public var ECBehaviorCollider collider | ||
| | ||
- | public func new() | + | public func new() super(" |
component = ECBehaviorComponent.new(this) | component = ECBehaviorComponent.new(this) | ||
collider = ECBehaviorCollider.new(this, | collider = ECBehaviorCollider.new(this, | ||
Line 142: | Line 142: | ||
| | ||
- | | + | |
- | // add behaviors: component, collider | + | // add required |
| | ||
| | ||
- | | ||
- | // set parameters | + | // |
- | // using a custom " | + | // |
+ | | ||
| | ||
| |