Пример #1
0
 public void StartGame()
 {
     if (gameState != GameState.Game)
     {
         canvasAnimator.SetTrigger("StartGame");
         lifes       = FindObjectOfType <Lifes>();
         waveDisplay = FindObjectOfType <WaveDisplay>();
         paused      = false;
         gameState   = GameState.Game;
         StartCoroutine(GameCycle());
     }
 }
Пример #2
0
    void Start()
    {
        //cache enemy info panel
        GameObject gui = GameObject.FindGameObjectWithTag ("Gui");
        enemyInfoPanels = gui.GetComponent<EnemyInfoPanels> ();
        waveDisplay = gui.GetComponent<WaveDisplay> ();

        // Create the waves

        currentFormation = new List<System.Action> ();

        formations = new List<List<System.Action>> ();

        for (int i = 0; i < 10; i++) {
            formations.Add (new List<System.Action> ());
        }

        //wave 1 – 10 plebs
        addObject (formations [0], 10, spawnPleb);

        //wave 2 - 8 plebs, 5 testudo
        addObject (formations [1], 8, spawnPleb);
        addObject (formations [1], 5, spawnTetsudo);

        //wave 3 - 10 plebs, 4 toads
        addObject (formations [2], 10, spawnPleb);
        addObject (formations [2], 4, spawnGood);

        //wave 4 - 8 plebs, 5 helicopter, 3 toads
        addObject (formations [3], 8, spawnPleb);
        addObject (formations [3], 5, spawnCopter);
        addObject (formations [3], 3, spawnGood);

        //wave 5 - 8 plebs, 2 testudo, 2 helicopter, 3 toads
        addObject (formations [4], 8, spawnPleb);
        addObject (formations [4], 2, spawnTetsudo);
        addObject (formations [4], 2, spawnCopter);
        addObject (formations [4], 3, spawnGood);

        //wave 6 - 10 plebs, 5 planes, 3 toads
        addObject (formations [5], 10, spawnPleb);
        addObject (formations [5], 5, spawnPlane);
        addObject (formations [5], 3, spawnGood);

        //wave 7 - 10 plebs, 2 testudo, 3 helicopter, 2 planes, 4 toads
        addObject (formations [6], 10, spawnPleb);
        addObject (formations [6], 2, spawnTetsudo);
        addObject (formations [6], 3, spawnCopter);
        addObject (formations [6], 2, spawnPlane);
        addObject (formations [6], 4, spawnGood);

        //wave 8 - 8 plebs, 10 testudo, 5 toads
        addObject (formations [7], 8, spawnPleb);
        addObject (formations [7], 10, spawnTetsudo);
        addObject (formations [7], 5, spawnGood);

        //wave 9 - 10 plebs, 4 helicopter, 4 planes, 4 testudo, 4 toads
        addObject (formations [8], 10, spawnPleb);
        addObject (formations [8], 4, spawnCopter);
        addObject (formations [8], 4, spawnPlane);
        addObject (formations [8], 4, spawnTetsudo);
        addObject (formations [8], 4, spawnGood);

        //wave 10 - SnailCraftCarrier (15 planes)
        addObject (formations [9], 1, spawnCraftCarrier);

        //set our current formation to the first formation
        currentFormation = formations [0];

        if (MainGui.doTutorial)
            initEnemyInfoPanels ();
    }
Пример #3
0
 void ClearWaveDisplay()
 {
     waveDisplay = null;
     fullWaveContentRect = new Rect();
 }
Пример #4
0
 private void Awake()
 {
     instance = this;
 }