예제 #1
0
        public void SetUpEnemies(Map map)
        {
            var types = map.enemyList;

            if (types.Count == 0)
            {
                return;
            }
            var enemyPlayer1 = PlayersManager.NeutralEnemyPlayer;

            for (var i = 0; i < ChunkManager.staticEnemyCount; i++)
            {
                var randomChunkPos = PlayersManager.GetRandomChunkPos();
                PlayersManager.ClearPosesForPlayer(randomChunkPos, 1);

                var enemyType = types[Random.Range(0, types.Count)];


                foreach (var entName in enemyType)
                {
                    var setup = AI_Calculation.FindFreePosNearPos(ChunkNumber, randomChunkPos, false);
                    SetupUnit(entName, new Vector3Int(setup.x, setup.y, 1), enemyPlayer1);
                }
            }
        }