I have an editor script in which you can choose textures and assign them to EditorGUILayout.ObjectFields. After the user has dragged textures(objects) into the object fields I’d like to know the paths of where they came from so I can perform other functions on them.
"Assets/Some/Path/YourObject.prefab" (if you select a prefab)
You can then get the absolute path (if needed) using:
using System.IO;
...
string filePath = Path.Combine(Directory.GetCurrentDirectory(), assetPath);
// i.e. "/Your Unity Project/Assets/Some/Path/YourObject.prefab"
// The following is needed if you are using Windows :-)
filePath = filePath.Replace("/", "\\");
// i.e. "C:\Your Unity Project\Assets\Some\Path\YourObject.prefab"