void SpawnUnitCreep(int waveId, UnitCreep creep) { Vector3 position = creep.path.waypoints[0]; GameObject go = ObjectPool.GetEnemy(transform.parent.gameObject, creep.prefab, position); go.name = creep.prefab.name + "_" + waveId + "_" + creep.id; PathFinder finder = go.GetComponent<PathFinder> (); if (finder != null) { finder.path = creep.path; } }
void SpawnUnitCreep(int waveId, UnitCreep creep) { Vector3 position = creep.path.waypoints[0]; GameObject go = ObjectPool.GetEnemy(transform.parent.gameObject, creep.prefab, position); go.name = creep.prefab.name + "_" + waveId + "_" + creep.id; PathFinder finder = go.GetComponent <PathFinder> (); if (finder != null) { finder.path = creep.path; } }