diff --git a/spine-libgdx/test/com/esotericsoftware/spine/AnimationStateTest.java b/spine-libgdx/test/com/esotericsoftware/spine/AnimationStateTest.java index 2d4d54efe..249516ff4 100644 --- a/spine-libgdx/test/com/esotericsoftware/spine/AnimationStateTest.java +++ b/spine-libgdx/test/com/esotericsoftware/spine/AnimationStateTest.java @@ -27,6 +27,8 @@ package com.esotericsoftware.spine; import com.badlogic.gdx.ApplicationAdapter; import com.badlogic.gdx.Gdx; +import com.badlogic.gdx.InputAdapter; +import com.badlogic.gdx.Input.Keys; import com.badlogic.gdx.backends.lwjgl.LwjglApplication; import com.badlogic.gdx.graphics.GL10; import com.badlogic.gdx.graphics.g2d.SpriteBatch; @@ -56,6 +58,7 @@ public class AnimationStateTest extends ApplicationAdapter { AnimationStateData stateData = new AnimationStateData(skeletonData); stateData.setMix("walk", "jump", 0.2f); stateData.setMix("jump", "walk", 0.4f); + stateData.setMix("jump", "jump", 0.2f); state = new AnimationState(stateData); state.setAnimation("walk", true); @@ -67,6 +70,19 @@ public class AnimationStateTest extends ApplicationAdapter { root.setY(20); skeleton.updateWorldTransform(); + + Gdx.input.setInputProcessor(new InputAdapter() { + public boolean touchDown (int screenX, int screenY, int pointer, int button) { + keyDown(0); + return true; + } + + public boolean keyDown (int keycode) { + state.setAnimation("jump", false); + state.addAnimation("walk", true); + return true; + } + }); } public void render () { diff --git a/spine-libgdx/test/com/esotericsoftware/spine/SkeletonTest.java b/spine-libgdx/test/com/esotericsoftware/spine/SkeletonTest.java index 9673cf19c..fdf6e3486 100644 --- a/spine-libgdx/test/com/esotericsoftware/spine/SkeletonTest.java +++ b/spine-libgdx/test/com/esotericsoftware/spine/SkeletonTest.java @@ -99,12 +99,15 @@ public class SkeletonTest extends ApplicationAdapter { skeleton.updateWorldTransform(); Gdx.input.setInputProcessor(new InputAdapter() { + public boolean touchDown (int screenX, int screenY, int pointer, int button) { + keyDown(0); + return true; + } + public boolean keyDown (int keycode) { - if (keycode == Keys.SPACE) { - if (name.equals("goblins")) { - skeleton.setSkin(skeleton.getSkin().getName().equals("goblin") ? "goblingirl" : "goblin"); - skeleton.setSlotsToSetupPose(); - } + if (name.equals("goblins")) { + skeleton.setSkin(skeleton.getSkin().getName().equals("goblin") ? "goblingirl" : "goblin"); + skeleton.setSlotsToSetupPose(); } return true; } @@ -122,7 +125,7 @@ public class SkeletonTest extends ApplicationAdapter { Gdx.gl.glClear(GL10.GL_COLOR_BUFFER_BIT); - animation.apply(skeleton, time, true); + animation.apply(skeleton, time, false); skeleton.updateWorldTransform(); skeleton.update(Gdx.graphics.getDeltaTime()); diff --git a/spine-unity/Assets/examples/Unity 3.5/spineboy/SpineboyComponent.cs b/spine-unity/Assets/examples/Unity 3.5/spineboy/SpineboyComponent.cs deleted file mode 100644 index 74680081e..000000000 --- a/spine-unity/Assets/examples/Unity 3.5/spineboy/SpineboyComponent.cs +++ /dev/null @@ -1,43 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2013, Esoteric Software - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR - * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - ******************************************************************************/ - -using UnityEngine; -using System.Collections; - -public class SpineboyComponent : MonoBehaviour { - public void OnMouseDown () { - SkeletonComponent skeletonComponent = GetComponent(); - skeletonComponent.animationName = "jump"; - skeletonComponent.loop = false; - } - - public void Update () { - SkeletonComponent skeletonComponent = GetComponent(); - if (!skeletonComponent.loop && skeletonComponent.state.Time >= skeletonComponent.state.Animation.Duration - 0.25) { - skeletonComponent.animationName = "walk"; - skeletonComponent.loop = true; - } - } -} diff --git a/spine-unity/Assets/examples/Unity 3.5/spineboy/SpineboyComponent.cs.meta b/spine-unity/Assets/examples/Unity 3.5/spineboy/SpineboyComponent.cs.meta deleted file mode 100644 index 758647ce6..000000000 --- a/spine-unity/Assets/examples/Unity 3.5/spineboy/SpineboyComponent.cs.meta +++ /dev/null @@ -1,7 +0,0 @@ -fileFormatVersion: 2 -guid: 1f998efe00dbbc246afece8f6a849fc6 -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0}