Passing the rotational component of a parent as a number

I have a solar system where each planet has a parent that controls its rotation around the sun. I am trying to get the rotational value of the parent so I can pass it as a number to another script controlling the rotation of the camera (when the planet is clicked I want the two to match).

What I’m asking is how do I read the rotational component of a parent object in C#. I’ve looked everywhere and I’ve found plenty regarding children, but very little on parents.

transform.parent.rotation, so to get angles, transform.parent.rotation.eulerAngles