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!