WIP: Music callback
- 头几拍会抖动一下,导致对不上拍子
This commit is contained in:
@@ -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();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user