public void InitiateSpawn(GameObject prefabToSpawn, GameObject spawnVisualPrefab, SpawnedObjectCallback callback) { this.PrefabToSpawn = prefabToSpawn; this.SpawnCallback = callback; Instantiate(spawnVisualPrefab, this.transform.position, Quaternion.identity); this.GetComponent <TimedCallbacks>().AddCallback(this, this.Spawn, this.SpawnDelay); }
public void InitiateSpawn(GameObject prefabToSpawn, GameObject spawnVisualPrefab, SpawnedObjectCallback callback) { this.PrefabToSpawn = prefabToSpawn; this.SpawnCallback = callback; Instantiate(spawnVisualPrefab, this.transform.position, Quaternion.identity); this.GetComponent<TimedCallbacks>().AddCallback(this, this.Spawn, this.SpawnDelay); }