public IEnemy MakeSprite(EnemyEnum spriteType, Vector2 location)
 {
     return(spriteType switch
     {
         EnemyEnum.Wallmaster => new Wallmaster(texture, location, game),
         EnemyEnum.TealGel => new Gel(texture, location, game, Color.Teal),
         EnemyEnum.BlueGel => new Gel(texture, location, game, Color.Blue),
         EnemyEnum.GreenGel => new Gel(texture, location, game, Color.Green),
         EnemyEnum.GoldGel => new Gel(texture, location, game, Color.Gold),
         EnemyEnum.LimeGel => new Gel(texture, location, game, Color.Lime),
         EnemyEnum.BrownGel => new Gel(texture, location, game, Color.Brown),
         EnemyEnum.GrayGel => new Gel(texture, location, game, Color.Gray),
         EnemyEnum.WhiteGel => new Gel(texture, location, game, Color.White),
         EnemyEnum.GreenZol => new Zol(texture, location, Color.Green, game),
         EnemyEnum.GoldZol => new Zol(texture, location, Color.Gold, game),
         EnemyEnum.LimeZol => new Zol(texture, location, Color.Lime, game),
         EnemyEnum.BrownZol => new Zol(texture, location, Color.Brown, game),
         EnemyEnum.GrayZol => new Zol(texture, location, Color.Gray, game),
         EnemyEnum.WhiteZol => new Zol(texture, location, Color.White, game),
         EnemyEnum.Snake => new Snake(texture, location, game),
         EnemyEnum.RedGoriya => new Goriya(texture, location, Color.Red, game),
         EnemyEnum.BlueGoriya => new Goriya(texture, location, Color.Blue, game),
         EnemyEnum.RedKeese => new Keese(texture, location, Color.Red, game),
         EnemyEnum.BlueKeese => new Keese(texture, location, Color.Blue, game),
         EnemyEnum.Stalfos => new Stalfos(texture, location, game),
         EnemyEnum.Trap => new Trap(texture, location, game),
         EnemyEnum.Trapparatus => new Trapparatus(texture, location, game),
         EnemyEnum.Owl => new Owl(texture2, location, game),
         EnemyEnum.FairyEnemy => new FairyEnemy(texture3, location, game),
         _ => throw new ArgumentException("Invalid sprite! " + spriteType.ToString() + " Sprite factory failed."),
     });
    void DoSpawn()
    {
        int    enemyCount = this.CalcSpawnCount();
        string s          = "";

        for (int i = 0; i < enemyCount; i++)
        {
            EnemyEnum type = this.CalculateEnemyType();
            BoidSpawnManager.Instance.AddToSpawnQueue(type);
            s += type.ToString() + " ";
        }
        Debug.Log(BeatManager.Instance.Intensity + ": " + enemyCount + " " + s);
    }
Beispiel #3
0
 public IEnemy MakeSprite(EnemyEnum spriteType, Vector2 location)
 {
     return(spriteType switch
     {
         EnemyEnum.Aquamentus => new Aquamentus(texture, location, game),
         EnemyEnum.Patra => new Patra(texture, location, game),
         EnemyEnum.Manhandla => new Manhandla(texture, location, game),
         EnemyEnum.Gleeok => new Gleeok(texture, location, game),
         EnemyEnum.Ganon => new Ganon(texture, location, game),
         EnemyEnum.OrangeGohma => new Gohma(texture, location, Color.Orange, game),
         EnemyEnum.BlueGohma => new Gohma(texture, location, Color.Blue, game),
         EnemyEnum.Dodongo => new Dodongo(texture, location, game),
         EnemyEnum.Digdogger => new Digdogger(texture, location, game),
         _ => throw new ArgumentException("Invalid sprite! " + spriteType.ToString() + " Sprite factory failed."),
     });
    private void SpawnEnemy(EnemyEnum enemy)
    {
        GameObject enemyObject = Instantiate(Resources.Load(enemy.ToString()), spawnPoint, true) as GameObject;

        enemyObject.transform.position = new Vector3(Random.Range(-spawnBounds.size.x / 2, spawnBounds.size.x / 2), spawnPoint.position.y);
    }