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.
27 lines
517 B
C#
27 lines
517 B
C#
using System;
|
|
using UnityEngine;
|
|
|
|
namespace D2D.Gameplay
|
|
{
|
|
[RequireComponent(typeof(ISpawner))]
|
|
public class SpawnTrigger : MonoBehaviour
|
|
{
|
|
private ISpawner Spawner
|
|
{
|
|
get
|
|
{
|
|
if (_spawner == null)
|
|
_spawner = GetComponent<ISpawner>();
|
|
|
|
return _spawner;
|
|
}
|
|
}
|
|
|
|
private ISpawner _spawner;
|
|
|
|
protected GameObject Trigger()
|
|
{
|
|
return Spawner.Spawn();
|
|
}
|
|
}
|
|
} |