This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using UnityEngine; | |
public enum KeyEventType | |
{ | |
OnKeyDown = 0, | |
OnKeyHold = 1, | |
OnKeyUp = 2, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
public class BeatDetector : MonoBehaviour | |
{ | |
public AudioSource audioSource; | |
public float beatThreshold = 0.2f; | |
private float[] samples; | |
private float previousVolume; |