// Use this for initialization void Start() { if (first) { ScoreStore.LoadOffline(); BeatmapStore.LoadAll(); } first = true; PlayButton.onClick.AddListener(() => { Initiate.Fade("SongSelectScene", Color.black, 2f); }); }
public void Start() { ScoreStore.LoadOffline(); if (BeatmapStore.Beatmaps == null) { BeatmapStore.LoadAll(); } SongListItemRect = SongListItemPrefab.GetComponent <RectTransform>().rect; ScoreListItemRect = ScoreListItemPrefab.GetComponent <RectTransform>().rect; AddItemsToList( BeatmapStore.Beatmaps.Count, SongListItemPrefab, VerticalSongSelectListPosition, SongListContentTransform, (GameObject songListItem, int index) => { SongListItem item = songListItem.GetComponent <SongListItem>(); item.Load(); item.SetBeatmapInfo(BeatmapStore.Beatmaps[index]); item.SelectedChange(false); } ); if (first) { Selected = UnityEngine.Random.Range(0, BeatmapStore.Beatmaps.Count); } else { Selected = Selected; } isStart = false; first = false; }