32 lines
745 B
C#
32 lines
745 B
C#
using Spine;
|
|
using Spine.Unity;
|
|
using System;
|
|
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
|
|
public class Tree : CombaSystem
|
|
{
|
|
private SkeletonAnimation skelet;
|
|
private Spine.AnimationState animationState;
|
|
protected override void Awake()
|
|
{
|
|
skelet = GetComponent<SkeletonAnimation>();
|
|
|
|
animationState = skelet.AnimationState;
|
|
//¶¯×÷Íê³ÉºóµÄ»Øµ÷
|
|
animationState.Complete += OnIdle;
|
|
|
|
}
|
|
|
|
private void OnIdle(TrackEntry trackEntry)
|
|
{
|
|
TrackEntry entry = skelet.AnimationState.SetAnimation(0, "animation", true);
|
|
}
|
|
|
|
public override void TakeDamage()
|
|
{
|
|
TrackEntry entry = skelet.AnimationState.SetAnimation(0, "hit", false);
|
|
}
|
|
}
|