source | The object to check. |
GameObject The Prefab root.
Returns the root GameObject of the Prefab that the supplied GameObject is part of.
This checks if the object is part of a Prefab (either a Prefab instance or a Prefab Asset). If so it 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.