예제 #1
0
 private void DoYourJob()
 {
     TowerData.BuildingType type = Data.Type;
     if (type == TowerData.BuildingType.Generator)
     {
         Grow();
     }
     else if (type == TowerData.BuildingType.Firewall)
     {
         Aim();
     }
 }
예제 #2
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();
            }
        }
    }
예제 #3
0
    public void ChangeType(TowerData.BuildingType newType)
    {
        if (isOperational)
        {
            TowerData.BuildingType currentType = Data.Type;

            if (newType != currentType && Data.Population >= ConvertionCost)
            {
                if (currentType == TowerData.BuildingType.Lab)
                {
                    Data.ControllerData.LooseLab();
                }

                Data.AddUnits(-ConvertionCost);
                isOperational = false;
                newLevel      = 0;
                this.newType  = newType;

                Particles.PlayTinker();
            }
        }
    }
예제 #4
0
파일: Tower_Hub.cs 프로젝트: epiCATT/poly
 public void ChangeType(TowerData.BuildingType newType)
 {
     TBehavior.ChangeType(newType);
 }