Minor updates.

This commit is contained in:
NathanSweet 2013-09-30 11:32:05 +02:00
parent 8fca7bf3ba
commit 0fb51b3869
2 changed files with 12 additions and 3 deletions

View File

@ -11,7 +11,7 @@ Shader "Skeleton" {
Pass {
ColorMaterial AmbientAndDiffuse
SetTexture [_MainTex] {
combine texture * primary
Combine texture * primary
}
}
}

View File

@ -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>();
skeletonAnimation = GetComponent<SkeletonAnimation>();
skeletonAnimation.state.SetAnimation(0, "walk", true);
skeletonAnimation.state.Event += new EventHandler<EventTriggeredArgs>(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>();
skeletonAnimation.state.SetAnimation(0, "jump", false);
skeletonAnimation.state.AddAnimation(0, "walk", true, 0);
}