示例#1
0
    /// <summary>
    /// 적 생성 코루틴.
    /// </summary>
    /// <param name="enemyKey"></param>
    /// <param name="path"></param>
    /// <param name="waveNumber"></param>
    /// <param name="enemyData"></param>
    /// <returns></returns>
    private IEnumerator CreateEnemyCoroutine(string enemyKey, List <Vector3> path, int waveNumber, EnemyData enemyData)
    {
        if (path == null)
        {
            yield break;
        }

        for (int i = 0; i < waveNumber; i++)
        {
            if (GameManager.Instance.GetIsGameOver())
            {
                mIsWaveStart = false;
                yield break;
            }
            GameObject enemyObject = new GameObject();
            EnemyClass enemy       = enemyObject.AddComponent <EnemyClass>();

            enemy.Initialize(mMap, enemyKey, path, enemyData);

            yield return(mWFSNextEnemySpawnTime);
        }
        mIsWaveStart = false;
    }