Пример #1
0
    public void SpawnBrain()
    {
        float x = transform.localPosition.x + BRAIN_OFFSET_X;
        float y = transform.localPosition.y + BRAIN_OFFSET_Y;
        float z = y;

        GameObject brain = Instantiate(SCR_Gameplay.instance.PFB_BRAIN, transform.parent);

        brain.transform.localPosition = new Vector3(x, y, z);
        brain.GetComponent <SCR_Brain>().SetValue(SCR_Config.GetProductionRate((int)type));
    }
Пример #2
0
    public void UpdateTotalProductionRate()
    {
        totalProductionRate = 0;

        for (int i = 0; i < SCR_Profile.NUMBER_ZOMBIES; i++)
        {
            int productionRate = SCR_Config.GetProductionRate(i) * SCR_Profile.numberZombies[i];
            totalProductionRate += productionRate;
        }

        txtTotalProductionRate.text = FormatNumber(totalProductionRate) + " brains/s";
    }
Пример #3
0
    public void RefreshUpgradeInfo()
    {
        for (int i = 0; i < zombieUpgradePrices.Length; i++)
        {
            int productionRate = SCR_Config.GetProductionRate(i);

            zombieLevels[i].text          = "LEVEL " + (SCR_Profile.upgradeZombies[i] + 1).ToString();
            zombieProductionRates[i].text = SCR_Gameplay.FormatNumber(productionRate) + " brains/s";
            zombieUpgradePrices[i].text   = SCR_Gameplay.FormatNumber(SCR_Config.GetUpgradePrice(i));
        }

        SCR_Gameplay.instance.UpdateTotalProductionRate();
    }
Пример #4
0
    public void Start()
    {
        for (int i = 0; i < zombiePrices.Length; i++)
        {
            string productionRate = SCR_Gameplay.FormatNumber(SCR_Config.GetProductionRate(i)) + " brains/s";

            zombieNames[i].text           = SCR_Config.ZOMBIE_INFO[i].name.ToUpper();
            zombieProductionRates[i].text = productionRate;
            zombiePrices[i].text          = SCR_Gameplay.FormatNumber(SCR_Config.ZOMBIE_INFO[i].price);
        }

        RefreshUnlocked();
        UpdateBrain();
    }
Пример #5
0
    public void UpdateZombie()
    {
        for (int i = 0; i < zombies.Length; i++)
        {
            zombies[i].SetActive(false);
        }

        zombies[currentZombie].SetActive(true);

        string productionRate = "Brains per second: " + SCR_Gameplay.FormatNumber(SCR_Config.GetProductionRate(currentZombie));

        txtName.text           = SCR_Config.ZOMBIE_INFO[currentZombie].name.ToUpper();
        txtProductionRate.text = productionRate.ToUpper();
        txtDescription.text    = SCR_Config.ZOMBIE_INFO[currentZombie].description.ToUpper();
    }