@@ -94,5 +94,8 @@ namespace Ichni.Editor
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -30,14 +30,31 @@ namespace Ichni.Editor
|
||||
private TimePointer MarkedPointer;
|
||||
public TMP_InputField TimeField;
|
||||
public TMP_InputField BeatField;
|
||||
|
||||
public Slider ProgressSlider;
|
||||
public RectTransform GetinputArea;
|
||||
|
||||
private string BeatText;
|
||||
private string TimeText;
|
||||
protected override void Start()
|
||||
{
|
||||
TimeField.onSelect.AddListener(_ => EditorManager.instance.musicPlayer.PauseMusic());
|
||||
BeatField.onSelect.AddListener(_ => EditorManager.instance.musicPlayer.PauseMusic());
|
||||
ProgressSlider.onValueChanged.AddListener(_ =>
|
||||
{
|
||||
EditorManager.instance.musicPlayer.PauseMusic();
|
||||
EditorManager.instance.songInformation.songTime = (ProgressSlider.value * EditorManager.instance.songInformation.songLength) - EditorManager.instance.songInformation.offset;
|
||||
UpdateTime();
|
||||
});
|
||||
|
||||
}
|
||||
public void Update()
|
||||
{
|
||||
if (EditorManager.instance.musicPlayer.isPlaying) UpdateTime();
|
||||
if (EditorManager.instance.musicPlayer.isPlaying)
|
||||
{
|
||||
UpdateTime();
|
||||
|
||||
|
||||
}
|
||||
|
||||
if (RectTransformUtility.RectangleContainsScreenPoint(GetinputArea, Mouse.current.position.ReadValue()))
|
||||
{
|
||||
@@ -45,14 +62,6 @@ namespace Ichni.Editor
|
||||
DetectSetRange();
|
||||
DetectPointer();
|
||||
}
|
||||
if (BeatField.text != BeatText)
|
||||
{
|
||||
BeatField.text = BeatText;
|
||||
}
|
||||
if (TimeField.text != TimeText)
|
||||
{
|
||||
TimeField.text = TimeText;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -165,6 +174,15 @@ namespace Ichni.Editor
|
||||
{
|
||||
TimeText = songTime.ToString("F2");
|
||||
BeatText = songBeat.ToString("F2");
|
||||
if (BeatField.text != BeatText)
|
||||
{
|
||||
BeatField.text = BeatText;
|
||||
}
|
||||
if (TimeField.text != TimeText)
|
||||
{
|
||||
TimeField.text = TimeText;
|
||||
}
|
||||
ProgressSlider.SetValueWithoutNotify((songTime - EditorManager.instance.songInformation.offset) / EditorManager.instance.songInformation.songLength);
|
||||
}
|
||||
|
||||
private Tweener _activeTweener = null; // 保存当前动画的引用
|
||||
|
||||
Reference in New Issue
Block a user