private void Awake()
    {
        if (!this.tower) this.tower = GetComponent<ArtilleryTower>();

        if (this.attackSpeedTimer == null) this.attackSpeedTimer = new Timer(this.AttackSpeed);
        else this.attackSpeedTimer.DefiniteTime = this.AttackSpeed;
        this.attackSpeedTimer.AfterTime = Random.Range(0, this.attackSpeedTimer.DefiniteTime);
    }
Esempio n. 2
0
        public override void TowerType(string buildType)
        {
            Rectangle empty = new Rectangle(0, 0, 0, 0);

            switch (buildType)
            {
            case "Rocket":
                mTowerToBeBuilt = new RocketTower(empty);
                break;

            case "MG":
                mTowerToBeBuilt = new MGTower(empty);
                break;

            case "Pulse":
                mTowerToBeBuilt = new PulseTower(empty);
                break;

            case "Flame":
                mTowerToBeBuilt = new FlameTower(empty);
                break;

            case "Artillery":
                mTowerToBeBuilt = new ArtilleryTower(empty);
                break;

            case "Concussion":
                mTowerToBeBuilt = new SlowingTower(empty);
                break;

            case "Command":
                mTowerToBeBuilt = new CommandCenter(empty);
                break;

            case "Rifle":
                mTowerToBeBuilt = new RifleTower(empty);
                break;

            case "Gamma":
                mTowerToBeBuilt = new GammaRayTower(empty);
                break;

            default:
                mTowerToBeBuilt = null;
                mCanBuild       = false;
                break;
            }
        }