56 lines
1.4 KiB
C#
56 lines
1.4 KiB
C#
using System;
|
|
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using Ichni;
|
|
using Ichni.Editor;
|
|
using Ichni.RhythmGame;
|
|
using TMPro;
|
|
using UnityEditor;
|
|
using UnityEngine;
|
|
|
|
public class TimelineTab : MonoBehaviour
|
|
{
|
|
public TMP_Text Title;
|
|
public GameElement connectedGameElement;
|
|
|
|
public SubTab ElementPrefab;
|
|
public List<GameElement> GelementPointer;
|
|
|
|
public RectTransform MoveArea;
|
|
public RectTransform title;
|
|
public Dictionary<float, SubTab> SubTabs = new();
|
|
|
|
public Timeline timeline;
|
|
public void SetTab(GameElement element, Type DisplayType)
|
|
{
|
|
connectedGameElement = element;
|
|
Title.text = DisplayType.ToString();
|
|
|
|
AddElement(element);
|
|
}
|
|
public void AddElement(GameElement gameElement)
|
|
{
|
|
|
|
GelementPointer.Add(gameElement);
|
|
if (gameElement is NoteBase)
|
|
{
|
|
float Judgetime = ((NoteBase)gameElement).exactJudgeTime;
|
|
print(Judgetime);
|
|
|
|
if (SubTabs.ContainsKey(Judgetime)) SubTabs[Judgetime].Set(gameElement, Judgetime);
|
|
else
|
|
{
|
|
SubTab i = Instantiate(ElementPrefab, MoveArea.transform);
|
|
i.father = this;
|
|
i.Set(gameElement, Judgetime);
|
|
SubTabs.Add(Judgetime, i);
|
|
}
|
|
}
|
|
}
|
|
private void Start()
|
|
{
|
|
timeline = EditorManager.instance.uiManager.timeline;
|
|
}
|
|
|
|
}
|