using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class BeatSyncAnimation : MonoBehaviour
{
private Animator animator;
private SpriteRenderer sprite;
private float bpm;
void Start()
{
animator = gameObject.GetComponent();
sprite = gameObject.GetComponent();
CriAtomExBeatSync.SetCallback(BeatSyncCallback);
}
void BeatSyncCallback(ref CriAtomExBeatSync.Info info)
{
animator.Play("Player_Dancing");
if (bpm != info.bpm)
{
Debug.Log("bpm is now :" + info.bpm);
bpm = info.bpm;
}
}
}