// Start is called before the first frame update private void Start() { dataSavingManager = GameObject.FindGameObjectWithTag("DataSavingManager").GetComponent <DataSavingManager>(); TotalBlocksSpawned = (int)dataSavingManager.GetOtherValue("TotalBlocksSpawned"); blockSpawnData = dataSavingManager.GetBlockSpawnData(); blockDictionary = new Dictionary <int, Transform>(); loadMapLevel = new UnityAction <object>(HandleLevelChange); EventManager.StartListening("LoadMapLevel", loadMapLevel); blockKilled = new UnityAction <object>(BlockKilled); EventManager.StartListening("BlockKilled", blockKilled); }
private void LoadBlockStats(object blockInfo) { Tuple <double, double> bHealthAndReward = (Tuple <double, double>)blockInfo; BlockSpawnData blockSpawnData = dataSavingManager.GetBlockSpawnData(); int bPerLevel = (int)dataSavingManager.GetOtherValue("BlocksPerLevel"); int totalBKills = (int)dataSavingManager.GetOtherValue("TotalBlocksKilled"); blockHealth.text = NumberUtils.FormatLargeNumbers(bHealthAndReward.Item1); blockKillReward.text = NumberUtils.FormatLargeNumbers(bHealthAndReward.Item2); blocksPerLevel.text = bPerLevel.ToString(); maxBlocksSpawned.text = blockSpawnData.maxCurrentBlocks.ToString(); blockSpawnSpeed.text = NumberUtils.FormatLargeNumbers(blockSpawnData.spawnTime); totalBlocksKilled.text = NumberUtils.FormatLargeNumbers(totalBKills); }