public void CreateNewTrack(TMP_InputField level) { m_beatTrack = new BeatTrack(); m_level = level.text; m_beatTrack.level = m_level; m_beatTrack.beats = new List <Beat>(); PlayMusic(); }
void CreateIconsFromPaths(string[] paths, string pathPrefix) { foreach (string s in paths) { string[] split = s.Split('/'); string level = split[split.Length - 1]; BeatTrack track = m_game.LoadObjectFromJson <BeatTrack>("Track", level); AddLevelIcon(track); } }
LevelIcon AddLevelIcon(BeatTrack track) { GameObject gameObject = Instantiate(m_levelIconTemplate, Vector3.zero, Quaternion.identity, m_currentRow.transform); LevelIcon icon = gameObject.GetComponent <LevelIcon>(); icon.m_track = track; gameObject.GetComponentInChildren <TextMeshProUGUI>().text = track.level; return(icon); }
public void LoadTrack(BeatTrack track) { m_beatTrack = track; m_level = m_beatTrack.level; foreach (Beat beat in m_beatTrack.beats) { m_beats.Add(beat); CreateBeatstamp(beat); } PlayMusic(); }
LevelIcon AddLevelIcon(BeatTrack track) { GameObject gameObject = Instantiate(m_levelIconTemplate, Vector3.zero, Quaternion.identity, m_levelsLocation); LevelIcon icon = gameObject.GetComponent <LevelIcon>(); icon.m_track = track; icon.m_canBeClicked = false; gameObject.GetComponentInChildren <TextMeshProUGUI>().text = track.level; if (m_levelsLocation.childCount > 3) { m_levelsLocation.GetComponent <RectTransform>().sizeDelta += Vector2.right * 200.0f; } m_iconList.Add(gameObject); return(icon); }
void CreateLevelIcons() { string[] levels = Directory.GetDirectories(Application.dataPath + "/StreamingAssets/CustomLevels/"); int rowCount = 0; foreach (string s in levels) { if (rowCount >= 3) { rowCount = 0; m_currentRow = AddNewRow(); } string[] split = s.Split('/'); string level = split[split.Length - 1]; BeatTrack track = m_game.LoadObjectFromJson <BeatTrack>("Track", level); AddLevelIcon(track); rowCount++; } }
public void StartTrack(BeatTrack track) { m_creator.LoadTrack(track); gameObject.SetActive(false); m_playerControls.SetActive(true); }