guidez

I have a habit of making guides, hence the name!

http://www.youtube.com/watch?v=dnQbS9ap-i8
guidez
  • 記事: 13

Nate

Awesome, thanks for that! :) Linked on the spine-tk2d page. 8)
https://github.com/EsotericSoftware/spi ... spine-tk2d
アバター
Nate

Nate
  • 記事: 9730

jimotion

Hi
I have followed this guide and its very cool.
my question is can i still use all the spine runtime features in the tk2d like add and mix animation etc.
from the example provided i can only swap animations and toggle the loop.
Ive tried adding and mixing from the docs but have had no luck so far.


thanks
jimotion

Kickstarter 2 backer
  • 記事: 23

Nate

Yes, you can access the skeleton field and use the spine-csharp API.
アバター
Nate

Nate
  • 記事: 9730

jimotion

public class Knight : MonoBehaviour {
private tk2dSpineAnimation skeleton;

void Start() {
skeleton = GetComponent<tk2dSpineAnimation>();
}

void LateUpdate() {
if (skeleton.loop) return;

if (skeleton.state.Animation != null && skeleton.state.Time >= skeleton.state.Animation.Duration - 0.25) {
skeleton.animationName = "walk";
skeleton.loop = true;
}
}

void OnMouseDown() {
skeleton.animationName = "Swipe";
skeleton.loop = false;
}
}
Hi thanks for your reply.

How do i get the skeleton field ?
I've been using the above code how could i combine the walk animation with the swipe ?
the swipe animation has no keys in the legs .
I'm aware of the principle and how it should work I've been through the run time docs but cant get anything I've tried to work so far.
does anyone have an example.

thanks
jimotion

Kickstarter 2 backer
  • 記事: 23

evs

Hello,

In your example you are accessing the tk2dSpineAnimation.

To get to the csharp api skeleton you can go via the tk2dSpineSkeleton something like...
private List<Bone> bones;

skeleton = GetComponent<tk2dSpineSkeleton>();

if(skeleton == null) throw new ArgumentNullException("skeleton");

bones = skeleton.skeleton.Bones;

if(bones == null) throw new ArgumentNullException("bones");

foreach(Bone bone in bones) {

Debug.Log("Bone " + bones.IndexOf(bone) + " " + bone.ToString());

}
Cheers

evs
アバター
evs
  • 記事: 27

outtoplay

That was terrific! Great vid, and really really helpful. Would love to see you make additional vids on the subject.

best,
Brendan G.
アバター
outtoplay

Kickstarter 2 backer
  • 記事: 3

jimotion

Thanks evs i Will try out your method Later today.
The video was really helpfull for getting animations into unity.
I also would love to see additional videos like this.
thanks guidez
jimotion

Kickstarter 2 backer
  • 記事: 23

guidez

Can we get this moved into the "Runtimes" Forum? Thanks!
guidez
  • 記事: 13

Rezwan

Is there a tutorial on importing Spine Animation into Unity without TK2D?
Rezwan
  • 記事: 1

guidez

I can make one, just need a bit of time.
guidez
  • 記事: 13


Return to Runtimes