diff --git a/Assets/Scripts/DynamicUI/Timeline/SubTab.cs b/Assets/Scripts/DynamicUI/Timeline/SubTab.cs index 4c613268..bec34a6a 100644 --- a/Assets/Scripts/DynamicUI/Timeline/SubTab.cs +++ b/Assets/Scripts/DynamicUI/Timeline/SubTab.cs @@ -12,12 +12,13 @@ public class SubTab : MonoBehaviour { public List connectObj = new(); public Button button; - //private SongInformation songInformation = EditorManager.instance.songInformation; + private SongInformation songInformation; private TimePointerModule timePointerModule; private Timeline timeline; public float Time; public void Set(GameElement Objs, float time) { + songInformation = EditorManager.instance.songInformation; timePointerModule = EditorManager.instance.uiManager.timeline.timePointerModule; timeline = EditorManager.instance.uiManager.timeline; Time = time; @@ -26,10 +27,20 @@ public class SubTab : MonoBehaviour } public void Update() { - - - Vector3 newPOs = B2P(Time); - transform.position = newPOs; + if (Time - timePointerModule.leftSideSongTime < 0) + { + transform.localScale = Vector3.zero; + return; + } + else + { + transform.localScale = Vector3.one; + float devideTime = Time - timePointerModule.leftSideSongTime; + transform.position = new Vector3( + devideTime / timeline.timePerBeat * timePointerModule.timePointerInterval + 165f - timePointerModule.delayDistanceOffset + , transform.position.y, 0 + ); + } } public void GetClick() @@ -37,10 +48,4 @@ public class SubTab : MonoBehaviour EditorManager.instance.uiManager.hierarchy.FindTab(connectObj[0]); } - - public Vector3 B2P(float Time) - { - Vector3 i = new(Time / timeline.timePerBeat * timePointerModule.timePointerInterval + 15f - timePointerModule.delayDistanceOffset + 150, transform.position.y, 0); - return i; - } } diff --git a/Assets/Scripts/DynamicUI/Timeline/TimePointerModule.cs b/Assets/Scripts/DynamicUI/Timeline/TimePointerModule.cs index a7ec1320..e65c3918 100644 --- a/Assets/Scripts/DynamicUI/Timeline/TimePointerModule.cs +++ b/Assets/Scripts/DynamicUI/Timeline/TimePointerModule.cs @@ -112,7 +112,7 @@ namespace Ichni.Editor timePointerArea.anchoredPosition = new Vector2((timePointerArea.sizeDelta.x / 2) - - ((startTime + songInformation.delay) / timeline.timePerBeat) * timePointerInterval, 0); + (startTime + songInformation.delay) / timeline.timePerBeat * timePointerInterval, 0); float proportion = mainTimePointer.anchoredPosition.x / visibleTimePointerArea.rect.width; @@ -125,6 +125,7 @@ namespace Ichni.Editor /// /// 细分X分音符 /// + private void CreatePointer(int beatDivider, int index) { TimePointer pointer = Instantiate(timePointerPrefab, timePointerArea).GetComponent(); diff --git a/Assets/Scripts/DynamicUI/Timeline/Timeline.cs b/Assets/Scripts/DynamicUI/Timeline/Timeline.cs index 6ddcd31d..080785ce 100644 --- a/Assets/Scripts/DynamicUI/Timeline/Timeline.cs +++ b/Assets/Scripts/DynamicUI/Timeline/Timeline.cs @@ -123,7 +123,7 @@ namespace Ichni.Editor } public void Trackfind(GameElement Track) - { + {//这也是if山 foreach (var i in Track.childElementList) { if (i is NoteBase) @@ -134,6 +134,7 @@ namespace Ichni.Editor timelineTab.SetTab(i, i.GetType()); timelineTabList.Add(i.GetType(), timelineTab); + } else { diff --git a/Assets/Scripts/DynamicUI/Timeline/TimelineTab.cs b/Assets/Scripts/DynamicUI/Timeline/TimelineTab.cs index 20da4e8a..28917f11 100644 --- a/Assets/Scripts/DynamicUI/Timeline/TimelineTab.cs +++ b/Assets/Scripts/DynamicUI/Timeline/TimelineTab.cs @@ -34,6 +34,7 @@ public class TimelineTab : MonoBehaviour else { SubTab i = Instantiate(ElementPrefab, transform); + i.Set(gameElement, Judgetime); SubTabs.Add(Judgetime, i); }