Are you instantiating each copy of the prefab by hand or by code?
If you are doing by code, you can edit settings right after instantiating.
This is just an concept, modify to your needs:
GameObject solarSystem = Instantiate(solarSystem, transform..., rotation...);
GameObject[] planets;
for (int i = 0; i < solarSystem.transform.childCount; i++){
planets[i] = originalGameObject.transform.GetChild(i).gameObject;
//Do something with child
if (planets[i].CompareTag("Earth")){
// If tag is earth, do your magic
}
else if (planets[i].CompareTag("...")){
// Planet is ..., do your magic
}
}
This may not work perfectly as intended, but can give you some directions.
If you are setting by hand, you need to save some information inside of the object so you can modify:
(Like creating a INT type
and modify in code based in this type)
// Put here the tag that every system root will have
GameObject[] solarSystems = GameObject.FindGameObjectsWithTag("Solar System");
for (int i = 0; i < solarSystems.count; i++){
for (int k = 0; k < solarSystems[i].transform.childCount; k++){
GameObject planet = solarSystems[i].transform.GetChild(k).gameObject;
if (planet.GetComponent<PlanetScript>().planetType == 1){
// Change to your needs
}
else if (planet.GetComponent<PlanetScript>().planetType == ...){
// Just keep adding this to match your needs
}
}
}