// Start is called before the first frame update
    void Start()
    {
        // Create a temporary reference to the current scene.
        Scene currentScene = SceneManager.GetActiveScene();

        // Retrieve the name of this scene.
        string sceneName = currentScene.name;

        // set the delay of the enemy depending on which level the player is on
        if (sceneName == "GameSceneL1")
        {
            spawnDelay = 30.0f;
        }
        else if (sceneName == "GameSceneL2")
        {
            spawnDelay = 20.0f;
        }
        else if (sceneName == "GameSceneL3")
        {
            spawnDelay = 20.0f;
        }

        // get the enemey parent object
        enemyParent = ParentUtils.GetEnemyParent();
        // need to get a list of spawn points
        spawnPoints = GetComponentsInChildren <SpawnPoint>();
        SpawnRepeating();
    }
 void Start()
 {
     // get the enemey parent object
     enemyParent = ParentUtils.GetEnemyParent();
     // need to get a list of spawn points
     spawnPoints = GetComponentsInChildren <SpawnPoint>();
     SpawnRepeating();
 }
예제 #3
0
    private List <Enemy> enemies;   // List of enemies
    #endregion

    // Start is called before the first frame update
    void Start()
    {
        enemies = new List <Enemy>(); // Instantiate new list of enemies

        /*
         * Using the ParentUtils class, get the enemy parent object. An attempt to find the game object is made first.
         * If unable to be found, the game object is created
         */
        enemyParent = ParentUtils.GetEnemyParent();
    }