1
This commit is contained in:
31
unity/Assets/Script/GameObject/Other/Tree.cs
Normal file
31
unity/Assets/Script/GameObject/Other/Tree.cs
Normal file
@@ -0,0 +1,31 @@
|
||||
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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user