feat: StartOffset
- 实现startOffset - 修复EndOffset = 0 + 循环播放时,音乐会大量重复播放的错误。 - 增加数据校验和 BeatClock 联动。StartOffset不正确时停止bar+级 callback。 - BeatClock 现在会在每次重新播放时重启,以解决EndOffset配置错误被舍弃时,拍子对不上的问题。
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
using UnityEngine;
|
||||
|
||||
namespace OCES.Audio
|
||||
{
|
||||
public partial class MusicContainerConfig
|
||||
@@ -13,5 +15,26 @@ namespace OCES.Audio
|
||||
return beats;
|
||||
return 4;
|
||||
}
|
||||
|
||||
public void Validate(MusicSegmentConfig segmentConfig)
|
||||
{
|
||||
foreach (MusicContainer container in this.m_musicContainerInfos.Values)
|
||||
{
|
||||
foreach (uint segmentId in container.Segments)
|
||||
{
|
||||
if (segmentId < 1000000)
|
||||
{
|
||||
MusicSegment segment = segmentConfig.QueryById(segmentId);
|
||||
if (segment is { IsOffBeat: true })
|
||||
{
|
||||
container.TimeSig = "";
|
||||
Debug.LogWarning($"[AudioSystem] {container.Id} Container含有错误配置的Segment {segment.Id}。" +
|
||||
"切换至此Container时将不会启动beat/grid回调");
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user