Implement enemy spawning and following waypoints
This commit is contained in:
14
Assets/Scripts/Components/SpawnComponent.cs
Normal file
14
Assets/Scripts/Components/SpawnComponent.cs
Normal file
@@ -0,0 +1,14 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class SpawnComponent : MonoBehaviour
|
||||
{
|
||||
public void Spawn(SpawnInformation info)
|
||||
{
|
||||
var gameObject = Instantiate(info.prefab, transform);
|
||||
gameObject.transform.position = info.position;
|
||||
gameObject.name = info.prefab.name;
|
||||
info.onSpawned.Invoke(gameObject);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user