a bug/problem I discovered in unity…
here is how you do it:
create a prefab gameObjects.
add a component on this GameObject. the component must have a variable that stores a GameObject.
in the inspector, select this variable and set it to a prefab GameObject (any).
now instantiate this prefab and select the variable. when you click on it in the inspector, the GameObject reference will become highlighted.
***notice: if you set this variable to any prefab, in you project assets, it will be set to this prefab and all is well. BUT, when you set it to the same prefab containing this script (itself) it will be now referencing the Instantiated GameObject in the scene Hierarchy instead of the prefab!!! This is a serious problem, if you need a GameObject to reference its own prefab!!
Also, EditorUtility.GetPrefabParent will work fine to get the prefab of an object, but this will only work in Editor mode, as it is an editor script.
so, in other words, there is no way to save a prefab GameObject within a variable contained within the prefab itself, and access it during runtime!!!