Set prefab to public variable of another script

Hi there

I’m trying to set a prefab from the project folder to a secondary scripts’ public variable. This is within an editor script.

Scenario is that the first script is creating a gameobject based on certain parameters. Once the user is happy with everything, they can press ‘save’, which creates the gameobject into a prefab.
I now want this prefab to be stored as a public variable onto another script (which is already attached to a gameobject in the hierarchy).

I can find the second script through calling something like:

		MyScript scriptInstance = FindObjectOfType( typeof(MyScript ) ) as MyScript ;

From within the first script, i’d like to then call something like

scriptInstance.m_prefabReference = m_myPrefabIjustMade;

Any ideas?
Cheers!

First thing that comes to mind is to pass the prefab path as a string to your second script and then use http://unity3d.com/support/documentation/ScriptReference/Resources.Load.html to get the actual prefab in there.
Though there might be more efficient ways to do it.