public void SpawnVFXAt(string prefabName, Vector3 location) { GameObject spawnInstance = Instantiate(Resources.Load <GameObject>("Art/VFX/" + prefabName), location, Quaternion.identity); VFXList.Add(spawnInstance); if (VFXList[VFXList.Count - 1].GetComponent <VFXScript>() != null) { VFXScript VFXScriptInstance = VFXList[VFXList.Count - 1].GetComponent <VFXScript>(); VFXScriptInstance.SetIndex(VFXList.Count - 1); } }
public void SpawnVFX(string prefabName) { GameObject spawnInstance = Instantiate(Resources.Load <GameObject>("Art/VFX/" + prefabName)); VFXList.Add(spawnInstance); if (VFXList[VFXList.Count - 1].GetComponent <VFXScript>() != null) { VFXScript VFXScriptInstance = VFXList[VFXList.Count - 1].GetComponent <VFXScript>(); VFXScriptInstance.SetIndex(VFXList.Count - 1); } }