timeline居然没看懂,那个点击估计得重写
这种要怎么侦测呀
This commit is contained in:
2025-02-21 19:36:03 +08:00
parent 6781de4d53
commit 65992750b0
26 changed files with 24998 additions and 23113 deletions

View File

@@ -24,7 +24,8 @@ namespace Ichni.Editor
public float intervalUnit;
public float timePointerInterval;
public float sizeNegative, sizePositive;
public int negativePointerAmount, positivePointerAmount, totalPointerAmount;
public int negativePointerAmount; // 负方向指示线的数量
public int positivePointerAmount, totalPointerAmount;
/// <summary>
/// delay时间区间中(-delay, 0)的距离偏移量
/// </summary>
@@ -71,9 +72,12 @@ namespace Ichni.Editor
intervalUnit = (60f / bpm) / beatDivider * 1000;
sizeNegative = delay * beatDivider / timeline.timePerBeat;
// 计算负方向指示线的数量
negativePointerAmount = Mathf.CeilToInt(sizeNegative);
sizePositive = songInformation.song.length * beatDivider / timeline.timePerBeat;
negativePointerAmount = Mathf.CeilToInt(sizeNegative);
positivePointerAmount = Mathf.CeilToInt(sizePositive);
totalPointerAmount = negativePointerAmount + positivePointerAmount;
@@ -143,9 +147,13 @@ namespace Ichni.Editor
/// </summary>
public void UpdatePointers()
{
// 计算延迟距离偏移量
delayDistanceOffset = timePointerInterval * (negativePointerAmount - sizeNegative);
// 更新指示线区域的大小
timePointerArea.sizeDelta = new Vector2(timePointerInterval * totalPointerAmount, 55f);
// 更新每个指示线的位置
foreach (var pointer in timePointerList)
{
pointer.GetComponent<RectTransform>().anchoredPosition =