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.
19 lines
451 B
C#
19 lines
451 B
C#
3 months ago
|
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);
|
||
|
}
|
||
|
}
|
||
|
}
|