Generate() private method

private Generate ( ) : bool
return bool
    void ProgressZone()
    {
        Debug.Log("Zone Cleared");
        switch (currentZone)
        {
        case 1:
            currentZone = 2;
            UnlockLaraVenom();
            PoisonBar.SetActive(true);
            LaraDialog(1);
            currentNpcs       = EnemiesOnZone2;
            EnemyCounter.text = currentNpcs.ToString();
            _enemyGenerator.Generate(currentZone, EnemiesOnZone2);
            break;

        case 2:
            currentZone = 3;
            UnlockZone3();
            LaraDialog(2);
            currentNpcs       = EnemiesOnZone3;
            EnemyCounter.text = currentNpcs.ToString();
            _enemyGenerator.Generate(currentZone, EnemiesOnZone3);
            break;

        case 3:
            currentZone = 4;
            BossArrives();
            LaraDialog(3);
            currentNpcs       = EnemiesOnZone4;
            EnemyCounter.text = currentNpcs.ToString();
            _enemyGenerator.Generate(currentZone, EnemiesOnZone4);
            break;
        }
    }
 private void Start()
 {
     currentZone     = 1;
     _enemyGenerator = GetComponent <EnemyGenerator>();
     _enemyGenerator.Generate(currentZone, EnemiesOnZone1);
     LaraDialog(0);
 }
Example #3
0
    // 웨이브 변경
    private void ChangeWave()
    {
        // 적 생성
        List <Character> enemyList = enemyGenerator.Generate();

        for (int i = 0; i < enemyList.Count; ++i)
        {
            _charAddTarget    += enemyList[i].AddTarget;
            _charDeleteTarget += enemyList[i].DeleteTarget;

            _charList.Add(enemyList[i]);
        }

        // 생성된 적으로 포커스 변경
        followCam.SetMainEnemy(enemyList[0].tr);
        followCam.ChangeTarget(_spawnRunTime);
    }
Example #4
0
    private GameObject GenerateWorldChunk(float positionX, bool buffered)
    {
        Debug.Log("new chunk at " + positionX);
        var eligibleChunkShapes = chunkShapes.Where(x => GameManager.Instance.distanceTraveled >= x.Difficulty - 1).ToList();

        var            chunk = (GameObject)Instantiate(worldChunkPrefab, new Vector3(positionX, GameManager.Instance.Area == GameManager.Areas.Bonus ? 100 : 0, 0), new Quaternion(0, 0, 0, 0));
        BaseChunkShape shape;

        if (buffered == false)
        {
            shape = new FlatShape();
        }
        else
        {
            shape = eligibleChunkShapes.RandomElement();
        }

        BaseBiome biome;

        if (buffered == false || lastBiome == null || lastBiome.IsSpecial)
        {
            biome = new GrassBiome();
        }
        else
        {
            biome = biomes.Choose();
        }

        chunkGenerator.Generate(chunk, shape, biome, buffered);
        coinGenerator.Generate(chunk, shape, biome, buffered);
        powerupGenerator.Generate(chunk, shape, biome, buffered);
        if (GameManager.Instance.distanceTraveled > 1)
        {
            enemyGenerator.Generate(chunk, shape, biome, buffered);
        }

        lastChunkPosX = (int)positionX;
        lastBiome     = biome;
        Debug.Log("lastChunkPosX = " + lastChunkPosX);
        return(chunk);
    }
Example #5
0
    private void UpdateWave()
    {
        if (!gameOver)
        {
            if (Wave < EnemyGenerator.Wave.Length - 1)
            {
                Wave++;
                WaveT.text = "Wave " + (Wave + 1);
                animator.Play("Show wave text");
                AsteroidsGenerator.Generate();
                EnemyGenerator.Generate(Wave);
            }
            else
            {
                animator.Play("Game win");
            }

            if (character != null)
            {
                character.isShooting = false;
            }
        }
    }
Example #6
0
    public void AddEnemy(GameObject gameObject)
    {
        EnemyGenerator enemy = new EnemyGenerator();

        enemy.Generate(gameObject);
    }