Get the name of an instance's prefab at runtime?

For savegame purposes I want to be able to access the name of an in-scene prefab’s master-prefab name.

I want to do this so that the savegame code knows which resource to load, using the Resources.Load() function.

I don’t want to rely on the GO’s name, since that could be renamed in the scene and break the link. I also don’t want to have to enter it by hand for all my GOs, since that would be error-prone.

Since prefab instances are linked to their masters (at least in the editor), is there a way to access this information programatically?

There is no way that I know of. Maybe you could programatically add a utility component each time you instantiate a prefab though Resources.Load that store the name of the prefab?

Something like this?

function LoadPrefab(var path : String) : GameObject
{
    var obj : GameObject = (GameObject)Resources.Load(path);
    var tracker : PrefabTracker = obj.AddComponent(PrefabTracker);
    tracker.path = path;
    return obj;
}