Esempio n. 1
0
    // Use this for initialization
    void Start()
    {
        amountOfEnemiesTotal = 20 + (GameManager.GetLevel() * 10);

        enemyBlimp     = FindObjectOfType <EnemyBlimp>().gameObject;
        blimp          = enemyBlimp.GetComponent <EnemyBlimp>();
        blimpMaxHealth = blimp.GetHealth();

        Debug.Log("Amount of enemies: " + GameManager.GetAmountOfEnemiesToDestroy() + " blimp health: " + blimpMaxHealth + " current level: " + GameManager.GetLevel());
    }
Esempio n. 2
0
    // Use this for initialization
    void Start()
    {
        numberOfEnemiesToSpawn += GameManager.GetLevel() * 10;

        if (!PlayerPrefs.HasKey("DelayPerWave"))
        {
            PlayerPrefs.SetInt("DelayPerWave", 1);
        }                                                                                   // Sets DelayPerWave to 1 second if no value is selected or saved.

        InvokeRepeating("SpawnWave", initalDelayForEnemies, PlayerPrefs.GetInt("DelayPerWave"));

        Vector3 blimpIdlePosition = new Vector3(-10, 25, 0);

        spawnBlimp = Instantiate(blimp, blimpIdlePosition, Quaternion.identity) as EnemyBlimp;

        Debug.Log("Enemies will spawn every " + PlayerPrefs.GetInt("DelayPerWave") + " second(s)");
    }