From 0fb51b38693c4c5cf3dc4dfb4502251216fd2587 Mon Sep 17 00:00:00 2001 From: NathanSweet Date: Mon, 30 Sep 2013 11:32:05 +0200 Subject: [PATCH] Minor updates. --- spine-unity/Assets/Spine/Shaders/Skeleton.shader | 2 +- spine-unity/Assets/examples/spineboy/Spineboy.cs | 13 +++++++++++-- 2 files changed, 12 insertions(+), 3 deletions(-) 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); }