Ejemplo n.º 1
0
    private void SpawnMonsters(LevelPoint[] enemySpawnPoints)
    {
        int count = 0;

        foreach (LevelPoint point in enemySpawnPoints)
        {
            try
            {
                int index = UnityEngine.Random.Range(0, monsterPrefabs.Length);
                SpawnAtLocation.Spawn(point.X, point.Y, monsterPrefabs[index]);
                count++;
                if (count == monsterCount)
                {
                    break;
                }
            }
            catch (Exception e)
            {
                Debug.LogError(e);
            }
        }
    }
Ejemplo n.º 2
0
 private void SpawnPlayer()
 {
     SpawnAtLocation.Spawn(m_builder.StartPoint.X, m_builder.StartPoint.Y, playerPrefab);
 }