You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
CrowdControl/Assets/3rd/D2D_Scripts/Gameplay/Spawners/PrefabSpawner.cs

19 lines
451 B
C#

using System.Collections.Generic;
using D2D.Gameplay;
using D2D.Utilities;
using D2D.Utils;
using UnityEngine;
namespace D2D
{
public class PrefabSpawner : MonoBehaviour, ISpawner
{
[SerializeField] private List<GameObject> _prefabs;
public GameObject Spawn()
{
return Instantiate(_prefabs.GetRandomElement(),
transform.position, Quaternion.identity, transform);
}
}
}