Exemplo n.º 1
0
    void SpawnEnemy()
    {
        GameTile spawnPoint = board.GetSpawnPoint(Random.Range(0, board.SpwanPointCount));
        Enemy    enemy      = enemyFactory.Get();

        enemy.SpawnOn(spawnPoint);
        enemies.Add(enemy);
    }
Exemplo n.º 2
0
    // 产生Enemy
    void SpawnEnemy(GameTile tile)
    {
        Enemy enemy = enemyFactory.Get();

        enemy.SpawnOn(tile);

        enemies.Add(enemy);
    }
Exemplo n.º 3
0
    private void SpawnEnemy(string url)
    {
        GameTile spawnPoint = board.GetRandomSpawnPoint();
        Enemy    enemy      = enemyFactory.Get();

        enemy.SetMaterialUrl(url);
        enemy.SpawnOn(spawnPoint);
        enemies.Add(enemy);
    }
Exemplo n.º 4
0
    private void SpawnEnemy()
    {
        var spawnPoint = Board.GetSpawnPoint(Random.Range(0, Board.SpawnPointCount));
        var enemy      = EnemyFactory.Get();

        enemy.SpawnOn(spawnPoint);

        _enemies.Add(enemy);
    }
Exemplo n.º 5
0
        public string CreateEnemies(int numberDungeon)
        {
            string nameDungeon;
            var    rnd = new Random();

            if (numberDungeon == 1)
            {
                nameDungeon = "***   Sick Forest   ***";
            }
            else if (numberDungeon == 3)
            {
                nameDungeon = "***   Robber Camp   ***";
            }
            else
            {
                nameDungeon = "***   Graveyard   ***";
            }
            enemies = new EnemyCollection <BaseEnemy>();
            int quantity = 10;
            int lvl;

            for (int i = 0; i < quantity; i++)
            {
                switch (numberDungeon)
                {
                case 1:
                {
                    lvl       = rnd.Next(1, 10);
                    baseEnemy = new Beast(lvl);
                    break;
                }

                case 3:
                {
                    lvl       = rnd.Next(11, 20);
                    baseEnemy = new Rogue(lvl);
                    break;
                }

                case 5:
                {
                    lvl       = rnd.Next(21, 30);
                    baseEnemy = new Skeleton(lvl);
                    break;
                }

                default:
                    break;
                }
                enemies.Add(baseEnemy);
            }
            return(nameDungeon);
        }
Exemplo n.º 6
0
 private void Awake()
 {
     gameObject.tag = TagManager.ENEMY;
     rb             = GetComponent <Rigidbody2D>();
     collection.Add(this);
 }