Пример #1
0
 public static void BuildTower(Vector3 buildPos)
 {
     switch (CurrentTowerType)
     {
         case Towers.Simple:
             var simple = new SimpleTower();
             simple.Build(buildPos);
             _towers.Add(simple.TowerGO);
             break;
         case Towers.Splash:
             var splash = new SplashTower();
             splash.Build(buildPos);
             _towers.Add(splash.TowerGO);
             break;
         case Towers.Frozen:
             var frozen = new FrozenTower();
             frozen.Build(buildPos);
             _towers.Add(frozen.TowerGO);
             break;
     }
 }
Пример #2
0
    // Update is called once per frame
    void Update()
    {
        if (Input.GetKeyDown(KeyCode.Z))
        {
            GameOver();
        }

        if (Input.GetKeyDown(KeyCode.M))
        {
            var minotaur = new Minotaur();
            minotaur.Summon();
        }
        if (Input.GetKeyDown(KeyCode.W))
        {
            var mage = new Mage();
            mage.Summon();
        }
        if (Input.GetKeyDown(KeyCode.B))
        {
            var tower = new SimpleTower();
            tower.Build(new Vector3(-39, 3, 92));
        }
        if (Input.GetKeyDown(KeyCode.S))
        {
            var tower = new FrozenTower();
            tower.Build(new Vector3(-39, 3, 92));
        }
        if (Input.GetKeyDown(KeyCode.F))
        {
            var tower = new FrozenTower();
            tower.Build(new Vector3(-39, 3, 92));
        }
    }