// Start is called before the first frame update void Start() { // Load list of songs if (SongSelection.Songlist.Count == 0) { SongSelection.ImportSongs(Defines.SongFolder); var meta = SongSelection.Songlist[0]; // 8 is Summery Globals.CurrentNoteCollection = new NoteCollection(meta); Globals.CurrentSongMetadata = Globals.CurrentNoteCollection.ParseFile(); Globals.MusicManager.LoadSong(Globals.CurrentSongMetadata.FilePath + Globals.CurrentSongMetadata.SongFilename, Globals.CurrentSongMetadata.BpmEvents); Globals.MusicManager.Offset = Globals.CurrentSongMetadata.PlaybackOffset * 1000; } GameObject.Find("DifficultyText").SetText(ConfigFile.GetLocalizedString("Sort_Title")); loadingLeft = GameObject.Find("LoadingLeft").GetComponent <RectTransform>(); loadingRight = GameObject.Find("LoadingRight").GetComponent <RectTransform>(); // Set sorting order for non-sprites GameObject.Find("LeftHold").GetComponent <MeshRenderer>().sortingLayerName = "LeftHold"; GameObject.Find("RightHold").GetComponent <MeshRenderer>().sortingLayerName = "Rightold"; GameObject.Find("LeftSlide").GetComponent <MeshRenderer>().sortingLayerName = "LeftHold"; GameObject.Find("RightSlide").GetComponent <MeshRenderer>().sortingLayerName = "RightHold"; }
// Start is called before the first frame update void Start() { if (!ConfigFile.IsLoaded) { ConfigFile.Load(); } loadingLeft = GameObject.Find("LoadingLeft").GetComponent <RectTransform>(); loadingRight = GameObject.Find("LoadingRight").GetComponent <RectTransform>(); BgLine.SetColor(ThemeColors.Blue); songCards = new List <CardBase>(); if (SongSelection.Songlist.Count == 0) { SongSelection.ImportSongs(Defines.SongFolder); } for (int i = 0; i < SongSelection.Songlist.Count; i++) { songCards.Add(new SongCard(Pools.SongCards.GetPooledObject(), SongSelection.Songlist[i])); songCards[i].Shift(i, SongSelection.CurrentSongIndex); } levelCards = new List <CardBase>(); for (int i = 0; i < 10; i++) { levelCards.Add(new FolderCard(Pools.FolderCards.GetPooledObject(), "LEVEL " + (i + 1))); } folderCards = new List <CardBase>(); foreach (var folder in SongSelection.FolderParams) { folderCards.Add(new FolderCard(Pools.FolderCards.GetPooledObject(), folder.Name)); } // No Songs if (SongSelection.Songlist.Count == 0) { GameState.GameMode = Mode.NoSongs; for (int i = 0; i < transform.childCount; i++) { transform.GetChild(i).gameObject.SetActive(false); } transform.Find("Bg").gameObject.SetActive(true); transform.Find("NoSongs").gameObject.SetActive(true); } init = true; }
// Start is called before the first frame update void Start() { if (!ConfigFile.IsLoaded) { ConfigFile.Load(); } loadingLeft = GameObject.Find("LoadingLeft").GetComponent <RectTransform>(); loadingRight = GameObject.Find("LoadingRight").GetComponent <RectTransform>(); BgLine.SetColor(ThemeColors.Blue); songCards = new List <CardBase>(); if (SongSelection.Songlist.Count == 0) { SongSelection.ImportSongs(Defines.SongFolder); } for (int i = 0; i < SongSelection.Songlist.Count; i++) { songCards.Add(new SongCard(Pools.SongCards.GetPooledObject(), SongSelection.Songlist[i])); songCards[i].Shift(i, SongSelection.CurrentSongIndex); } levelCards = new List <CardBase>(); for (int i = 0; i < 10; i++) { levelCards.Add(new FolderCard(Pools.FolderCards.GetPooledObject(), "LEVEL " + (i + 1))); } folderCards = new List <CardBase>(); foreach (var folder in SongSelection.FolderParams) { switch (folder.Type) { case SortType.Title: folder.Name = ConfigFile.GetLocalizedString("Sort_Title"); break; case SortType.Artist: folder.Name = ConfigFile.GetLocalizedString("Sort_Artist"); break; case SortType.Level: folder.Name = ConfigFile.GetLocalizedString("Sort_Level"); break; default: break; } folderCards.Add(new FolderCard(Pools.FolderCards.GetPooledObject(), folder.Name)); } transform.Find("AutoModeText").gameObject.SetText(ConfigFile.GetLocalizedString("Auto_Mode_Enabled")); // No Songs if (SongSelection.Songlist.Count == 0) { GameState.GameMode = Mode.NoSongs; for (int i = 0; i < transform.childCount; i++) { transform.GetChild(i).gameObject.SetActive(false); } transform.Find("Bg").gameObject.SetActive(true); transform.Find("NoSongs").gameObject.SetActive(true); } else { backgroundImage = GameObject.Find("BgLine").GetComponent <UnityEngine.UI.RawImage>(); if (backgroundImage != null && backgroundImage.texture != null) { backgroundImage.texture.wrapMode = TextureWrapMode.Repeat; } } init = true; }