How to get notification of moving a GameObject in the hierachy when editing the scene?

Hello, im making an asset and using editorscripting where i need to get a notification when the developer have moved a gameObject in the hiearchy.

A very simple example could be

[33176-book+example.png|33176]

Here, i have two GameObjects with a “Book” component, and those Books have a GameObject array that have “Page” components. They both need reference to eachother.

So if i for example want to move the ManualPage GameObject to BookTwo as a child, then i need to set the new references so the Page have the correct reference to its Book (parent) and the Book have to add the ManualPage to the Pages array so it knows it contains the ManualPage

So how can i get the notification when moving a gameobject?
I have tried “OnInspectorGUI()” which will be called if i move a gameobject with a Page component, then i can always set/check if it has moved, but if the page is a child of an empty gameobject, and i move the empty gameobject to another Book, then the “OnInspectorGUI” wont be fired, so then the Page will not get notified.

Hope someone has a solution.
Thanks in advance.

You could try to use OnHierarchyChange()

But this is when you are using an EditorWindow.