可能的性能优化
This commit is contained in:
@@ -0,0 +1,92 @@
|
||||
using System.IO;
|
||||
|
||||
namespace OCES.Audio
|
||||
{
|
||||
/// <summary>
|
||||
/// 替换策略类型
|
||||
/// </summary>
|
||||
public enum KillMode : byte
|
||||
{
|
||||
Oldest, // 打断最早开始的
|
||||
Newest, // 打断最新开始的
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 混音分组
|
||||
/// </summary>
|
||||
public enum MixingType : byte
|
||||
{
|
||||
Sfx = 0,
|
||||
Music,
|
||||
Voice,
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 声音容器类型
|
||||
/// </summary>
|
||||
public enum ContainerType : byte{
|
||||
Random = 0,
|
||||
Sequence,
|
||||
Blend,
|
||||
}
|
||||
|
||||
public enum BlendCrossFadeType : byte
|
||||
{
|
||||
Exponential = 0,
|
||||
Linear,
|
||||
Logarithmic,
|
||||
}
|
||||
|
||||
public enum AlignMode : byte
|
||||
{
|
||||
Immediate,
|
||||
Beat,
|
||||
Bar,
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 游戏状态
|
||||
/// </summary>
|
||||
public enum GameState
|
||||
{
|
||||
Home,
|
||||
Game,
|
||||
Win,
|
||||
Lose,
|
||||
Guitar,
|
||||
Bass,
|
||||
}
|
||||
|
||||
public interface IBinarySerializable
|
||||
{
|
||||
void DeSerialize(BinaryReader reader);
|
||||
void Serialize(BinaryWriter writer);
|
||||
}
|
||||
|
||||
// ─────────────────────────────────────────────
|
||||
// 辅助接口,让泛型方法同时处理 MusicPath 和 AmbiencePath
|
||||
// ─────────────────────────────────────────────
|
||||
|
||||
public interface IPathEntry
|
||||
{
|
||||
uint Id { get; }
|
||||
string Path { get; }
|
||||
uint ContainerId { get; }
|
||||
int Priority { get; }
|
||||
}
|
||||
|
||||
public interface ITransitionConfig
|
||||
{
|
||||
float FadeOutOffset { get; }
|
||||
float FadeOutTime { get; }
|
||||
float FadeInOffset { get; }
|
||||
float FadeInTime { get; }
|
||||
}
|
||||
|
||||
public partial class MusicTransition : ITransitionConfig { }
|
||||
public partial class AmbienceTransition : ITransitionConfig { }
|
||||
|
||||
|
||||
public partial class MusicPath : IPathEntry { }
|
||||
public partial class AmbiencePath : IPathEntry { }
|
||||
}
|
||||
Reference in New Issue
Block a user