Getting Parent Context while in Prefab Edit Mode

I would like to be able to access the source scene and any prefabs in the edit hierarchy. To explain, I have a UI system that uses parent game objects to determine the context for UI binding. This means that, as an example, in:

Encounter (scene)
EncounterCanvas (prefab)
HostPanel (prefab)
HostName (component)

Host name navigates up to the EncounterCanvas to get a component there. This works fine at run time, however, I added a custom editor at edit time that gives some info on HostName, that looks up the context path. This custom editor works fine when in scene mode, but when in prefab edit mode, when I have HostPanel open, it can no longer navigate up the hierarchy to EncounterCanvas to figure out the context.

So I was wondering, is there some way to access the parent game object of a prefab when editing it?

Hi. In short, no. In Prefab mode, the contents of the Prefab Asset are loaded separately from the rest of the GameObjects in the Scene. The changes made will affect all its Prefab Instances, which can have different parents. In your case, with HostPanel open, its parent EncounterCanvas won’t be loaded and therefore not accessible.

There is more about it here: Unity - Manual: Editing a Prefab in Prefab Mode

Ah, okay, ty for the clarification