This commit is contained in:
2026-05-06 17:52:45 -07:00
parent 9fc3f35125
commit 1463c23334
402 changed files with 3758 additions and 0 deletions

View File

@ -0,0 +1 @@
Press keyboard `1`, `2`, `3` to change the animation action

View File

@ -0,0 +1,39 @@
package lnx;
class ActionPlayer extends iron.Trait {
function getAnim() {
// Trait placed on mesh object
var anim = object.animation;
// Trait placed on armature object - retrieve animation from child mesh
if (anim == null) anim = object.children[0].animation;
return anim;
}
public function new() {
super();
notifyOnInit(function() {
var anim = getAnim();
anim.notifyOnMarker("my_marker", function() {
trace("Marker!");
});
});
notifyOnUpdate(function() {
var kb = iron.system.Input.getKeyboard();
var anim = getAnim();
if (kb.started("1")) anim.play("idle");
else if (kb.started("2")) anim.play("run");
else if (kb.started("3")) anim.play("slash", onSlash);
else if (kb.started("6")) anim.pause();
else if (kb.started("7")) anim.resume();
});
}
function onSlash() {
trace("Slash animation played!");
}
}

Binary file not shown.