SpawnEnemy() private method

private SpawnEnemy ( SpawnSet, spawnSet ) : IEnumerator
spawnSet SpawnSet,
return IEnumerator
    /// <summary>
    /// This controls the order of events for the UFO spawner. enables and disables the tracktor beam mesh and plays and stops the animation for the tracktor beam.
    /// </summary>
    /// <returns></returns>
    IEnumerator UfoSpawn()
    {
        ufo.Pause();
        yield return(new WaitForSeconds(.5f));

        tractorBeam.enabled = true;
        tracktorBeamAnimator.SetBool("isUp", false);
        //Spawn Enemy
        spawn.SpawnEnemy();
        yield return(new WaitForSeconds(1f));

        tracktorBeamAnimator.SetBool("isUp", true);
        tracktorBeamAnimator.SetBool("isUp", false);
        //Spawn Enemy
        spawn.SpawnEnemy();
        yield return(new WaitForSeconds(1f));

        tracktorBeamAnimator.SetBool("isUp", true);
        yield return(new WaitForSeconds(1f));

        tracktorBeamAnimator.SetBool("isUp", false);
        //Spawn Enemy
        spawn.SpawnEnemy();
        yield return(new WaitForSeconds(1f));

        tracktorBeamAnimator.SetBool("isUp", true);
        tractorBeam.enabled = false;
        yield return(new WaitForSeconds(.5f));

        ufo.Resume();
    }
Beispiel #2
0
    private void Level_1(int wave)
    {
        switch (wave)
        {
        case 1:
            spawnEnemies.SpawnEnemy(3, 3, "LaserEnemy", 10, 1, 2);
            break;

        case 2:
            spawnEnemies.SpawnEnemy(3, 3, "RocketEnemy", 10, 1, 2);
            break;

        case 3:
            spawnEnemies.SpawnEnemy(5, 3, "FireEnemy", 10, 1, 2);
            break;
        }
    }