using UnityEngine;
using System.Collections;

public class Victor_Player : MonoBehaviour {

    Player mPlayer;
    [System.Serializable]
    public class TorcidaArray
    {
        public Animator[] torcida;
    }
    [SerializeField]
    public TorcidaArray[] FilasDeTorcida;
    void Awake()
    {
        mPlayer = FindObjectOfType<Player>();
        mPlayer.hitEvent += AnimateColumn;
    }

	// Use this for initialization
	void AnimateColumn()
    {
        StartCoroutine(MakeWave());
    }
    IEnumerator MakeWave()
    {
        int index = ((12 - 1) - mPlayer.mCount);
        //era pra ser um simples 'index = mPlayer.mCount' mas
        //o vetor ta ao contrario por razoes whatever.
        for (int i = index * 20; i < index * 20 + 20; i++)
        {
            FindObjectOfType<CharAnimationTiming>().crowdAnimations[i].SetTrigger("Wave");
            yield return new WaitForSeconds(0.05f);
        }
        yield return null;
    }
}
