2017-11-11 18:51:40 +01:00
|
|
|
package armory.logicnode;
|
|
|
|
|
|
|
|
import iron.object.Object;
|
|
|
|
|
|
|
|
class OnActionMarkerNode extends LogicNode {
|
|
|
|
|
2019-12-19 23:54:08 +01:00
|
|
|
public function new(tree: LogicTree) {
|
2017-11-11 18:51:40 +01:00
|
|
|
super(tree);
|
|
|
|
|
2018-03-02 14:50:58 +01:00
|
|
|
tree.notifyOnInit(init);
|
2017-11-11 18:51:40 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
function init() {
|
2019-12-19 23:54:08 +01:00
|
|
|
var object: Object = inputs[0].get();
|
|
|
|
var marker: String = inputs[1].get();
|
|
|
|
|
2017-11-11 18:51:40 +01:00
|
|
|
if (object == null) return;
|
2018-03-02 14:50:58 +01:00
|
|
|
var animation = object.animation;
|
|
|
|
if (animation == null) animation = object.getParentArmature(object.name);
|
2019-12-19 23:54:08 +01:00
|
|
|
|
2018-10-25 23:45:58 +02:00
|
|
|
animation.notifyOnMarker(marker, function() { runOutput(0); });
|
2017-11-11 18:51:40 +01:00
|
|
|
}
|
|
|
|
}
|