public GameData( GameObject[,,] _grid, List <GameObject> _bridgesList, string _playerName, string _cityName, bool _isTutorialRun, int _cycleNumber, float _cycleProgression, Dictionary <Population, PopulationManager.PopulationInformation> _populations, List <int> _lockedBuildings, List <Population> _populationTypeList, List <BulletinsManager.Bulletin> _bulletinList, BulletinsManager.Bulletin _currentBulletin, List <EventManager.EventMarker> _eventsPool ) { grid = _grid; bridgesList = _bridgesList; playerName = _playerName; cityName = _cityName; isTutorialRun = _isTutorialRun; cycleNumber = _cycleNumber; cycleProgression = _cycleProgression; populations = _populations; lockedBuildings = _lockedBuildings; populationTypeList = _populationTypeList; bulletinList = _bulletinList; currentBulletin = _currentBulletin; eventsPool = _eventsPool; }
// New saveData from game values public SaveData(GameData gameData) { // Storing grid gridSize = new Vector3Int(gameData.grid.GetLength(0), gameData.grid.GetLength(1), gameData.grid.GetLength(2)); blockGrid = ConvertBlocksGrid(gameData.grid, gridSize); // Storing bridges bridges = ConvertBridges(gameData.bridgesList); // Population informations popSaveData = ConvertPopulationInformations(gameData.populations); populationTypeIds = ConvertPopulationTypeList(gameData.populationTypeList); // Unlocks lockedBuildings = gameData.lockedBuildings; // Bulletins pool bulletinList = gameData.bulletinList; currentBulletin = gameData.currentBulletin; // Events pool eventsPool = gameData.eventsPool; // Other data playerName = gameData.playerName; cityName = gameData.cityName; cyclesPassed = gameData.cycleNumber; timeOfDay = gameData.cycleProgression; isTutorialRun = gameData.isTutorialRun; }
public IEnumerator RefreshBulletin() { if ( currentBulletin == null || GameManager.instance.bulletinsManager.GetBulletin().id != currentBulletin.id ) { Localization loc = GameManager.instance.localization; while (loc.GetLanguages().Count <= 0) { yield return(null); } currentBulletin = GameManager.instance.bulletinsManager.GetBulletin(); title.text = loc.GetLineFromCategory("bulletinTitle", "bulletin" + currentBulletin.id.ToString()).ToUpper(); subTitle.text = loc.GetLineFromCategory("bulletinSubtitle", "bulletin" + currentBulletin.id.ToString()); text.text = loc.GetLineFromCategory("bulletinText", "bulletin" + currentBulletin.id.ToString()); SetUnread(!opened); } yield return(new WaitForSeconds(FindObjectOfType <Interface>().refreshRate)); yield return(StartCoroutine(RefreshBulletin())); }