WIP: Music callback

- 头几拍会抖动一下,导致对不上拍子
This commit is contained in:
2026-04-07 10:06:02 +08:00
parent a04c08d4cf
commit 69944f44ea
21 changed files with 362 additions and 61 deletions
@@ -26,6 +26,11 @@ namespace OCES.Audio
// 公开接口
// ─────────────────────────────────────────────
public event Action<uint> OnBeat;
public event Action<uint> OnBar;
public event Action<uint> OnGrid;
public void Play(uint audioId, Action onPlay = null)
{
AudioObject obj = this.m_audioObjects.QueryById(audioId);
@@ -170,6 +175,10 @@ namespace OCES.Audio
musicPool,
ambiencePool);
this.m_musicSystem.OnBeat += id => this.OnBeat?.Invoke(id);
this.m_musicSystem.OnBar += id => this.OnBar?.Invoke(id);
this.m_musicSystem.OnGrid += id => this.OnGrid?.Invoke(id);
// ── 注册 StateGroup ──
EnumIds.RegisterAllGameState();