Exemplo n.º 1
0
    // 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);
    }
Exemplo n.º 2
0
    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);
    }
Exemplo n.º 3
0
 public void SetBlockSpawnData(BlockSpawnData blockSpawnData)
 {
     gameData.blockSpawnData = blockSpawnData;
 }