source | The object to check. |
GameObject The Prefab root.
Retrieves the root GameObject of the Prefab that the supplied GameObject is part of.
This method checks if the object is part of a Prefab (either a Prefab instance or a Prefab Asset) and if so, returns the root GameObject of the Prefab.
This method is used internally in the Editor to help the user select the correct object when GameObjects are clicked in the Scene view.