Skip to content

Commit

Permalink
Merge pull request #3083 from t3du/FixTweenNodes
Browse files Browse the repository at this point in the history
Fix Tween Nodes: add OnRemove Stop
  • Loading branch information
luboslenco authored Nov 26, 2024
2 parents 755046a + 662199c commit 6ba78bd
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 3 deletions.
7 changes: 7 additions & 0 deletions Sources/armory/logicnode/TweenFloatNode.hx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ class TweenFloatNode extends LogicNode {

public function new(tree:LogicTree) {
super(tree);
tree.notifyOnRemove(onRemove);
}

override function run(from:Int) {
Expand Down Expand Up @@ -111,4 +112,10 @@ class TweenFloatNode extends LogicNode {
function done() {
runOutput(2);
}

function onRemove() {
if(anim != null){
Tween.stop(anim);
}
}
}
9 changes: 8 additions & 1 deletion Sources/armory/logicnode/TweenRotationNode.hx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ class TweenRotationNode extends LogicNode {

public function new(tree:LogicTree) {
super(tree);
tree.notifyOnRemove(onRemove);
}

override function run(from:Int) {
Expand Down Expand Up @@ -112,5 +113,11 @@ class TweenRotationNode extends LogicNode {

function done() {
runOutput(2);
}
}

function onRemove() {
if(anim != null){
Tween.stop(anim);
}
}
}
10 changes: 9 additions & 1 deletion Sources/armory/logicnode/TweenTransformNode.hx
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ class TweenTransformNode extends LogicNode {

public function new(tree:LogicTree) {
super(tree);
tree.notifyOnRemove(onRemove);
}

override function run(from:Int) {
Expand Down Expand Up @@ -125,5 +126,12 @@ class TweenTransformNode extends LogicNode {

function done() {
runOutput(2);
}
}

function onRemove() {
if(anim != null){
Tween.stop(anim);
}
}

}
9 changes: 8 additions & 1 deletion Sources/armory/logicnode/TweenVectorNode.hx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ class TweenVectorNode extends LogicNode {

public function new(tree:LogicTree) {
super(tree);
tree.notifyOnRemove(onRemove);
}

override function run(from:Int) {
Expand Down Expand Up @@ -112,5 +113,11 @@ class TweenVectorNode extends LogicNode {

function done() {
runOutput(2);
}
}

function onRemove() {
if(anim != null){
Tween.stop(anim);
}
}
}

0 comments on commit 6ba78bd

Please sign in to comment.