Skip to content

Commit

Permalink
Merge pull request #3100 from t3du/OnTimerNode
Browse files Browse the repository at this point in the history
OnTimerNode: add false to true case
  • Loading branch information
luboslenco authored Dec 9, 2024
2 parents 05accc9 + abf7c31 commit 6f10ca4
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion armory/Sources/armory/logicnode/OnTimerNode.hx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,13 @@ class OnTimerNode extends LogicNode {
tree.notifyOnUpdate(update);
}

function reactivate() {
if (inputs[1].get() == true){
tree.notifyOnUpdate(update);
tree.removeUpdate(reactivate);
}
}

function update() {

if (duration <= 0.0) {
Expand All @@ -20,7 +27,7 @@ class OnTimerNode extends LogicNode {

duration -= iron.system.Time.delta;
if (duration <= 0.0) {
if (!repeat) tree.removeUpdate(update);
if (!repeat) { tree.removeUpdate(update); tree.notifyOnUpdate(reactivate); }
runOutput(0);
}
}
Expand Down

0 comments on commit 6f10ca4

Please sign in to comment.