using Spine; using System.Collections; using System.Collections.Generic; using UnityEngine; public class EventWashingFinger : MonoBehaviour { Animator animator; void Awake() { animator = this.GetComponent(); 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; } } }