Hi, struggling with this.
I need to select a prefab from the project window as I want to populate my scene with prefabs when running an Editor script.
Trying variations of this: prefab example is called ‘eyes’
using UnityEngine;
using UnityEditor;
//#pragma warning disable
public class buildAssetsForFace : MonoBehaviour
{
[MenuItem("Examples/Instantiate Selected")]
static void cheese()
{
Selection.activeObject = AssetDatabase.LoadMainAssetAtPath("Assets/prefab/" + eyes + ".prefab");
}
}
from here
But its super old and perhaps not relevant anymore