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); } }