Files
ichni_Creator_Studio/Assets/Scripts/DynamicUI/Timeline/SubTab.cs
TRAfoer dfa136eb3a 我需要帮助😭
timeline下面的子菜单不知道怎么适配比例
还有性能不是很好(TimeLineTabS)下面的一坨
2025-02-21 21:12:57 +08:00

52 lines
1.5 KiB
C#

using System.Collections;
using System.Collections.Generic;
using System.Linq;
using Ichni;
using Ichni.Editor;
using Ichni.RhythmGame;
using TMPro;
using UnityEngine;
using UnityEngine.UI;
public class SubTab : MonoBehaviour
{
public List<GameElement> connectObj = new();
public Button button;
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;
connectObj.Add(Objs);
button.GetComponentInChildren<TMP_Text>().text = connectObj.Count().ToString();
}
public void Update()
{
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()
{
EditorManager.instance.uiManager.hierarchy.FindTab(connectObj[0]);
}
}