Beispiel #1
0
    public void LevelUP()
    {
        if (isOperational)
        {
            int   currentLevel = Data.Level;
            float cost         = UpgradeCost[currentLevel];

            if (currentLevel < 2 && Data.Population >= cost)
            {
                Data.AddUnits(-cost);
                isOperational = false;
                newLevel      = currentLevel + 1;
                newType       = Data.Type;

                Particles.PlayTinker();
            }
        }
    }