You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
CrowdControl/Assets/Feel/MMTools/Tools/MMRadio/MMRadioSignal/MMRadioSignalAudioAnalyzer.cs

27 lines
714 B
C#

3 months ago
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
namespace MoreMountains.Tools
{
/// <summary>
/// A class used to expose a beat level from a target MMAudioAnalyzer, to be broadcasted by a MMAudioBroadcaster
/// </summary>
public class MMRadioSignalAudioAnalyzer : MMRadioSignal
{
[Header("Audio Analyzer")]
/// the MMAudioAnalyzer to read the value on
public MMAudioAnalyzer TargetAnalyzer;
/// the ID of the beat to listen to
public int BeatID;
/// <summary>
/// On Shake, we output our beat value
/// </summary>
protected override void Shake()
{
base.Shake();
CurrentLevel = TargetAnalyzer.Beats[BeatID].CurrentValue * GlobalMultiplier;
}
}
}