mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2025-12-21 01:36:02 +08:00
Jump for IK demo.
This commit is contained in:
parent
d12251ae19
commit
0e9b434385
@ -13,6 +13,7 @@
|
||||
<input id="hoverboard-drawbones" type="checkbox"></input> Display Bones<br>
|
||||
<input id="hoverboard-aim" type="checkbox"></input> Aim<br>
|
||||
<button id="hoverboard-shoot">Shoot</button>
|
||||
<button id="hoverboard-jump">Jump</button>
|
||||
</center>
|
||||
|
||||
<script>
|
||||
|
||||
@ -84,24 +84,35 @@ var hoverboardDemo = function(loadingComplete, bgColor) {
|
||||
renderer.skeletonDebugRenderer.drawBones = this.checked;
|
||||
});
|
||||
|
||||
var aimTrack = 1;
|
||||
var shootAimTrack = 2;
|
||||
var shootTrack = 3;
|
||||
|
||||
$("#hoverboard-aim").change(function () {
|
||||
if (!this.checked)
|
||||
state.setEmptyAnimation(1, 0.2);
|
||||
state.setEmptyAnimation(aimTrack, 0.2);
|
||||
else {
|
||||
state.setEmptyAnimation(1, 0);
|
||||
state.addAnimation(1, "aim", true, 0).mixDuration = 0.2;
|
||||
state.setEmptyAnimation(aimTrack, 0);
|
||||
state.addAnimation(aimTrack, "aim", true, 0).mixDuration = 0.2;
|
||||
}
|
||||
});
|
||||
|
||||
$("#hoverboard-shoot").click(function () {
|
||||
state.setAnimation(2, "aim", true);
|
||||
state.setAnimation(3, "shoot", false).listener = {
|
||||
state.setAnimation(shootAimTrack, "aim", true);
|
||||
state.setAnimation(shootTrack, "shoot", false).listener = {
|
||||
complete: function (trackIndex) {
|
||||
state.setEmptyAnimation(2, 0.2);
|
||||
state.clearTrack(3);
|
||||
state.setEmptyAnimation(shootAimTrack, 0.2);
|
||||
state.clearTrack(shootTrack);
|
||||
}
|
||||
};
|
||||
});
|
||||
|
||||
$("#hoverboard-jump").click(function () {
|
||||
state.setAnimation(aimTrack, "jump", false);
|
||||
state.addEmptyAnimation(aimTrack, 0.6, 0);
|
||||
if ($("#hoverboard-aim").prop("checked"))
|
||||
state.addAnimation(aimTrack, "aim", true, 0.5).mixDuration = 0.2;
|
||||
});
|
||||
}
|
||||
|
||||
function setupInput () {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user