MusicBeat

This commit is contained in:
SoulliesOfficial
2026-05-26 00:21:27 -04:00
parent 649b7a5ddc
commit b5cb6152ff
663 changed files with 534461 additions and 587 deletions

View File

@@ -0,0 +1,64 @@
#if UNITY_EDITOR
using System;
using System.Collections.Generic;
using UnityEngine;
namespace Cielonos.MainGame.Editor
{
/// <summary>
/// 节拍预设数据,用于编辑器中快速给节拍标记应用 tags 和颜色
/// </summary>
[Serializable]
public class BeatPreset
{
/// <summary>
/// 预设显示名称
/// </summary>
public string displayName;
/// <summary>
/// 预设 tags添加节拍时自动附带
/// </summary>
public List<string> tags;
/// <summary>
/// 编辑器中该预设对应的颜色
/// </summary>
public Color color;
public BeatPreset()
{
displayName = "New Preset";
tags = new List<string>();
color = Color.cyan;
}
public BeatPreset(string displayName, List<string> tags, Color color)
{
this.displayName = displayName;
this.tags = tags ?? new List<string>();
this.color = color;
}
/// <summary>
/// 检查指定 BeatMarker 的 tags 是否与本预设完全匹配
/// </summary>
public bool MatchesTags(List<string> markerTags)
{
if (markerTags == null || markerTags.Count == 0)
return tags == null || tags.Count == 0;
if (tags == null || tags.Count != markerTags.Count)
return false;
for (int i = 0; i < tags.Count; i++)
{
if (!markerTags.Contains(tags[i]))
return false;
}
return true;
}
}
}
#endif

View File

@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: e8b585d86f9f54847ae6e73de15f584d

View File

@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: b6a89c3d1ef423d4caeebb66af064d24