void SetSelected() { List <VoicesManager.VoiceData> list = VoicesManager.Instance.videogames_names; VoicesManager.Instance.PlaySpecificClipFromList(list, videgameID); videogameData = Data.Instance.videogamesData.all [videgameID]; missionSelector.LoadVideoGameData(videgameID); diskette.Init(videogameData); int _videgameID = videgameID + 1; if (_videgameID > 2) { _videgameID = 0; } VideogameData _videogameData = Data.Instance.videogamesData.all[_videgameID]; diskette2.Init(_videogameData, false); //videogameUI.Change (); if (Data.Instance.playMode == Data.PlayModes.STORYMODE) { Data.Instance.handWriting.WriteTo(credits, videogameData.credits, null); } else { Data.Instance.handWriting.WriteTo(creditsParty, videogameData.credits, null); } }
void InitButton(MissionButton diskette, int id) { VideogameData data = Data.Instance.videogamesData.all[id]; diskette.Init(data); diskette.SetMobile(this); diskette.GetComponent <MissionSelector>().LoadVideoGameData(id); diskette.GetHiscore(); }
void InitStoryMode() { Data.Instance.events.OnInterfacesStart(); data = Data.Instance; missions = data.missions; int videogameID = 0; int lastVideoGameID = -1; all = new List <MissionButton> (); int id_in_videogame = 0; foreach (Mission mission in missions.missions) { MissionButton button = Instantiate(uiButton) as MissionButton; button.Init(mission, missionID); if (lastVideoGameID != mission.videoGameID) { lastVideoGameID = mission.videoGameID; id_in_videogame = 0; MissionsByVideogame mbv = new MissionsByVideogame(); allMissionsByVideogame.Add(mbv); mbv.missions = new List <Mission> (); } else { id_in_videogame++; } button.id_in_videogame = id_in_videogame; lastButton = button; button.videoGameID = mission.videoGameID; if (videogameID == 0 && id_in_videogame > data.levelUnlocked_level_1 && !Data.Instance.DEBUG) { button.disableButton(); } else if (videogameID == 1 && id_in_videogame > data.levelUnlocked_level_2 && !Data.Instance.DEBUG) { button.disableButton(); } videogameID = mission.videoGameID; missionID++; all.Add(button); allMissionsByVideogame [videogameID].missions.Add(mission); } all.Sort(GetIdByVideogame); all.Reverse(); foreach (MissionButton mission in all) { mission.transform.SetParent(container); mission.transform.localScale = new Vector3(1, 1, 1); mission.transform.localPosition = new Vector3(mission.videoGameID * separation_in_x, 0, mission.id_in_videogame * separation); } videogameUI = GetComponent <VideogamesUIManager> (); videogameUI.Init(0); all.Reverse(); SetSelected(); }