How can i modify the hirarchy of a game object

The point is this:
I have a large number of Spheres and Extern Objects and now i want to change the extern objects into children of a sphere ^^
i want to do this because i want the extern object to be “in” the sphere and if you click on the sphere the sphere becomes disabled.
also i want to randomly hide the objects under random spheres

to say it in a few words: it should be a memory game with pokemon figures

(by the way i want to do it with C# ^^)

You can change the hierarchy by setting the .parent property of the child’s Transform to the new parent:

  child.transform.parent = newOwner.transform;