feat: 核心功能实现

This commit is contained in:
2026-04-09 16:26:45 +08:00
parent 302e4e35a9
commit 156285a691
12 changed files with 988 additions and 4 deletions
@@ -11,8 +11,36 @@ namespace OCES.Haptic
public enum HapticType
{
Preset = 0, //播放预制
Transient = 1, //播放瞬时
Continuous = 2, //播放连续
Emphasis = 1, //播放瞬时
Constant = 2, //播放连续
Advance = 3, //播放文件
}
/// <summary>
/// 文件操作类
/// </summary>
public static class FileManager
{
/// <summary>
/// 从内存流中读取二进制
/// </summary>
/// <param name="bytes"></param>
/// <param name="data"></param>
/// <returns></returns>
public static bool ReadBinaryDataFromBytes(byte[] bytes, ref IBinarySerializable data)
{
if (bytes == null)
return false;
using (MemoryStream memoryStream = new(bytes))
{
using (var br = new BinaryReader(memoryStream))
{
data.DeSerialize(br);
br.Close();
}
memoryStream.Close();
}
return true;
}
}
}