813f4254c9
- Add PlayOnTrigger method to AudioSystem for scheduling audio playback on music sync events (beat/bar/grid) - Rename ButtonInvoker to SetStateBind for better clarity - Update PlaySoundBind to support both direct playback and trigger-based playback with callback flags - Add CallbackFlags enum (MusicSyncBeat, MusicSyncBar, MusicSyncGrid) - Update Metronome demo to use new callback flag naming convention - Add test audio file sfx_notice_test.wav - Update scene UI to demonstrate PlayOnTrigger functionality
30 lines
651 B
C#
30 lines
651 B
C#
using UnityEngine;
|
|
using UnityEngine.UI;
|
|
using OCES.Audio;
|
|
using UnityEngine.Audio;
|
|
|
|
namespace OCES
|
|
{
|
|
public class SetStateBind : MonoBehaviour
|
|
{
|
|
public GameState targetGameState;
|
|
public bool enableLowpass;
|
|
public Text buttonText;
|
|
|
|
Button m_button;
|
|
|
|
void Awake()
|
|
{
|
|
this.buttonText.text = this.buttonText.text.Replace("PlaceHolder", this.targetGameState.ToString());
|
|
}
|
|
|
|
|
|
public void OnButtonPressed()
|
|
{
|
|
AudioSystem.Instance.SetState(this.targetGameState);
|
|
|
|
AudioSystem.Instance.SetLowpass(this.enableLowpass);
|
|
}
|
|
}
|
|
}
|