using System;
using UnityEngine;
using System.Collections.Generic;

[Serializable]
public class SpawningRules : Rule
{
    protected override void ApplyRule()
    {
        // spawn randomly a prefab in a spawing area.
        GameObject gameObj = m_prefabs[UnityEngine.Random.Range(0, m_prefabs.Count)];

        Vector2 spawnPosition = GameManager.GetSpawner().GetSpawnPosition();

        GameObject.Instantiate(gameObj, spawnPosition, Quaternion.identity);
    }
}
