备份CatanBuilding瘦身独立工程
This commit is contained in:
41
Assets/Scripts/UI/Washing/EventWashingFinger.cs
Normal file
41
Assets/Scripts/UI/Washing/EventWashingFinger.cs
Normal file
@@ -0,0 +1,41 @@
|
||||
using Spine;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class EventWashingFinger : MonoBehaviour
|
||||
{
|
||||
Animator animator;
|
||||
|
||||
void Awake()
|
||||
{
|
||||
animator = this.GetComponent<Animator>();
|
||||
SetAnimationEnabled(false);
|
||||
}
|
||||
|
||||
public void PlayAnimationForPainting()
|
||||
{
|
||||
PlayAnimation("finger_loop_wash");
|
||||
}
|
||||
public void PlayAnimationDefault()
|
||||
{
|
||||
PlayAnimation("finger_loop_wash2");
|
||||
}
|
||||
|
||||
private void PlayAnimation(string name)
|
||||
{
|
||||
SetAnimationEnabled(true);
|
||||
if (animator != null)
|
||||
{
|
||||
animator.Play(name);
|
||||
}
|
||||
}
|
||||
|
||||
public void SetAnimationEnabled(bool enabled)
|
||||
{
|
||||
if (animator != null)
|
||||
{
|
||||
animator.enabled = enabled;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user