public void SelectLyric(LyricEditorItemInterface interfaceSelected) { // Find new lyric to select for (int i = 0; i < currentLyrics.Count; ++i) { var lyric = currentLyrics[i]; if (lyric.lyricItemInterface == interfaceSelected) { SelectLyric(i); return; } } currentSelectedItemIndex = INVALID_ITEM_INDEX; }
public void Add() { LyricEditorItemInterface newLyricInterface = GameObject.Instantiate(lyricItemTemplate, lyricItemTemplate.transform.parent).GetComponent <LyricEditorItemInterface>(); newLyricInterface.gameObject.SetActive(true); var newItem = new LyricItem(newLyricInterface); currentLyrics.Add(newItem); PositionAllLyrics(); if (currentSelectedItemIndex == INVALID_ITEM_INDEX) { SelectLyric(currentLyrics[0].lyricItemInterface); } }
void PopulateFromCurrentSong() { Song currentSong = ChartEditor.Instance.currentSong; ClearLyricObjects(); foreach (MoonscraperChartEditor.Song.Event eventObject in currentSong.events) { if (eventObject.title.StartsWith(LyricEditorItemInterface.c_lyricPrefix)) { LyricEditorItemInterface newLyricInterface = GameObject.Instantiate(lyricItemTemplate, lyricItemTemplate.transform.parent).GetComponent <LyricEditorItemInterface>(); newLyricInterface.gameObject.SetActive(true); var newItem = new LyricItem(newLyricInterface); newItem.lyricItemInterface.SetLyricEvent(eventObject); currentLyrics.Add(newItem); } } SelectLyric(INVALID_ITEM_INDEX); }
public LyricItem(LyricEditorItemInterface lyricItemInterface) { this.lyricItemInterface = lyricItemInterface; }