using System.Collections.Generic;
using UnityEngine;

public class CharacterAnimationController : MonoBehaviour
{
    static CharacterAnimationController _instance;
    public static CharacterAnimationController instance
    {
        get
        {
            return _instance;
        }
    }

    public enum AnimationType
    {
        Idle,
        Wave,
        HandsUp,
        Kiss,
        Salut,
        ChestBeat,
		Happy,
		Sad
    }

    [SerializeField]
    SkeletonAnimation _creatureAnimation;

    Dictionary<AnimationType, string> _animationNameToSpineMap = new Dictionary<AnimationType, string>()
    {
        {AnimationType.Idle, "idle"},
        {AnimationType.Wave, "wave"},
        {AnimationType.HandsUp, "hands_up"},
        {AnimationType.Kiss, "kiss"},
        {AnimationType.Salut, "salut"},
        {AnimationType.ChestBeat, "chest_beat"},
		{AnimationType.Happy, "happy"},
		{AnimationType.Sad, "angry"}
    };
		
    public void PlayAnimation(AnimationType animationType)
    {
		_creatureAnimation.state.AddAnimation(1 ,_animationNameToSpineMap[animationType], false, 0);
    }

    void Start()
    {
        _instance = this;
        //_creatureAnimation.state.SetAnimation(1000, _animationNameToSpineMap[AnimationType.Idle], true);
    }

    // Update is called once per frame
    void Update()
    {

    }
}
