using OCES.Audio;
using UnityEngine;

namespace OCES
{
    /// <summary>
    /// Drag this component to any game object.
    /// Then you will get a metronome :) 
    /// </summary>
    public class Metronome : MonoBehaviour
    {
        void Start()
        {
            AudioSystem.Instance.OnBeat += u =>
            {
                AudioSystem.Instance.Play(52);
                Debug.Log($"Container {u} is MusicSyncBeat");
            };
            AudioSystem.Instance.OnBar += u =>
            {
                AudioSystem.Instance.Play(53);
                Debug.Log($"Container {u} is MusicSyncBar");
            };
            AudioSystem.Instance.OnGrid += u =>
            {
                AudioSystem.Instance.Play(54);
                Debug.Log($"Container {u} is MusicSyncGrid");
            };
        }
    }
}
