暂时存档
Timeline WindowAnim不止window能用
This commit is contained in:
@@ -12,15 +12,15 @@ namespace Ichni.Editor
|
||||
{
|
||||
private Timeline timeline => EditorManager.instance.uiManager.timeline;
|
||||
private SongInformation songInformation => EditorManager.instance.songInformation;
|
||||
|
||||
|
||||
public GameObject timePointerPrefab;
|
||||
public List<TimePointer> timePointerList;
|
||||
|
||||
|
||||
public RectTransform timePointerArea;
|
||||
public RectTransform visibleTimePointerArea;
|
||||
|
||||
|
||||
public RectTransform mainTimePointer;
|
||||
|
||||
|
||||
public float intervalUnit;
|
||||
public float timePointerInterval;
|
||||
public float sizeNegative, sizePositive;
|
||||
@@ -29,7 +29,7 @@ namespace Ichni.Editor
|
||||
/// delay时间区间中,(-delay, 0)的距离偏移量
|
||||
/// </summary>
|
||||
public float delayDistanceOffset;
|
||||
|
||||
|
||||
public float leftSideSongTime, rightSideSongTime, songTimeDistance;
|
||||
|
||||
private void Start()
|
||||
@@ -62,20 +62,20 @@ namespace Ichni.Editor
|
||||
/// <param name="delay"></param>
|
||||
/// <param name="bpm"></param>
|
||||
public void Initialize(float delay, float bpm)
|
||||
{
|
||||
{
|
||||
timePointerInterval = 30;
|
||||
ClearPointers();
|
||||
|
||||
|
||||
int beatDivider = 1;
|
||||
|
||||
|
||||
intervalUnit = (60f / bpm) / beatDivider * 1000;
|
||||
|
||||
|
||||
sizeNegative = delay * beatDivider / timeline.timePerBeat;
|
||||
sizePositive = songInformation.song.length * beatDivider / timeline.timePerBeat;
|
||||
|
||||
|
||||
negativePointerAmount = Mathf.CeilToInt(sizeNegative);
|
||||
positivePointerAmount = Mathf.CeilToInt(sizePositive);
|
||||
|
||||
|
||||
totalPointerAmount = negativePointerAmount + positivePointerAmount;
|
||||
|
||||
timePointerArea.sizeDelta = new Vector2(timePointerInterval * (sizeNegative + sizePositive), 60f);
|
||||
@@ -90,12 +90,12 @@ namespace Ichni.Editor
|
||||
{
|
||||
CreatePointer(beatDivider, i);
|
||||
}
|
||||
|
||||
|
||||
//ChangeSongTimeDistance(0);
|
||||
SetRange(timeline.beatmapStartTime);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public partial class TimePointerModule
|
||||
{
|
||||
/// <summary>
|
||||
@@ -115,7 +115,7 @@ namespace Ichni.Editor
|
||||
leftSideSongTime = startTime - songTimeDistance * proportion;
|
||||
rightSideSongTime = startTime + songTimeDistance * (1 - proportion);
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 生成指示线
|
||||
/// </summary>
|
||||
@@ -132,13 +132,16 @@ namespace Ichni.Editor
|
||||
|
||||
pointer.time = index * intervalUnit / 1000f;
|
||||
pointer.intervalUnitText.text = Mathf.RoundToInt(index * intervalUnit).ToString();
|
||||
|
||||
if (beatDivider > 1)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 更新指示线位置
|
||||
/// </summary>
|
||||
private void UpdatePointers()
|
||||
public void UpdatePointers()
|
||||
{
|
||||
delayDistanceOffset = timePointerInterval * (negativePointerAmount - sizeNegative);
|
||||
timePointerArea.sizeDelta = new Vector2(timePointerInterval * totalPointerAmount, 55f);
|
||||
@@ -149,7 +152,7 @@ namespace Ichni.Editor
|
||||
new Vector2((pointer.index + negativePointerAmount) * timePointerInterval + 15f - delayDistanceOffset, 0);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 清楚所有指示线
|
||||
/// </summary>
|
||||
@@ -161,7 +164,7 @@ namespace Ichni.Editor
|
||||
}
|
||||
timePointerList.Clear();
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 缩放时间线的展示时间宽度
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user