57 lines
1.8 KiB
C#
57 lines
1.8 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;
|
|
public TimelineTab timelineTab;
|
|
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();
|
|
transform.localPosition = new Vector3(
|
|
timelineTab.MoveArea.localPosition.x + (time / timeline.timePerBeat * timePointerModule.timePointerInterval)
|
|
, transform.localPosition.y, 0
|
|
);
|
|
}
|
|
// 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]);
|
|
}
|
|
|
|
}
|