diff --git a/spine-unity/Assets/Spine/Shaders/Skeleton.shader b/spine-unity/Assets/Spine/Shaders/Skeleton.shader index 833421cb4..d45e63954 100644 --- a/spine-unity/Assets/Spine/Shaders/Skeleton.shader +++ b/spine-unity/Assets/Spine/Shaders/Skeleton.shader @@ -11,7 +11,7 @@ Shader "Skeleton" { Pass { ColorMaterial AmbientAndDiffuse SetTexture [_MainTex] { - combine texture * primary + Combine texture * primary } } } diff --git a/spine-unity/Assets/examples/spineboy/Spineboy.cs b/spine-unity/Assets/examples/spineboy/Spineboy.cs index f3a50d380..7804b21b7 100644 --- a/spine-unity/Assets/examples/spineboy/Spineboy.cs +++ b/spine-unity/Assets/examples/spineboy/Spineboy.cs @@ -33,15 +33,24 @@ using UnityEngine; using System.Collections; +using Spine; +using System; public class Spineboy : MonoBehaviour { + SkeletonAnimation skeletonAnimation; + public void Start () { - SkeletonAnimation skeletonAnimation = GetComponent(); + skeletonAnimation = GetComponent(); skeletonAnimation.state.SetAnimation(0, "walk", true); + + skeletonAnimation.state.Event += new EventHandler(Event); } + public void Event (object sender, EventTriggeredArgs e) { + Debug.Log(e.TrackIndex + " " + skeletonAnimation.state.GetCurrent(e.TrackIndex) + ": event " + e.Event + ", " + e.Event.Int); + } + public void OnMouseDown () { - SkeletonAnimation skeletonAnimation = GetComponent(); skeletonAnimation.state.SetAnimation(0, "jump", false); skeletonAnimation.state.AddAnimation(0, "walk", true, 0); }