How would I go about doing this? Are there any Tutorials or Information I can use?
I think you are looking for switch/case or if/elseif/else statments. Not sure what you meant by spawn a prefab on another object so I assumed you wanted them to share position.
public enum ID {
Prefab1, Prefab2,
}
public class Script {
public void SpawnComponent(ID id, GameObject gameObject){
switch(id){
case ID.Prefab1: {
GameObject newObj=Object.Instantiate(Resources.Load("Prefab1")) as GameObject;
newObj.transform.position=gameObject.transform.position;
break;
}
case ID.Prefab2: {
GameObject newObj=Object.Instantiate(Resources.Load("Prefab2")) as GameObject;
newObj.transform.position=gameObject.transform.position;
break;
}
}
}
}
Just give the prefab the name of the id you want.