I have a custom editow window that displays a list of prefabs. This displays the name and preview image of each prefabs in the list, and allows the artist to add to the list by dragging a prefab from the project and dropping it on a spot in the list.
I am trying to migrate this whole system to using Addressables. I have modified the code to work with AssetReference types rather then GameObject. However I am unsure of how to go from the dropped Object to an AssetReferece in code.
Previously it looked like this:
prefab.prefab = (GameObject)EditorGUIUtility.GetObjectPickerObject();
EDIT: Actually that code is from another section where we display the object picker to let the artist select the prefab that way, so oops. The Drag and Drop way we have in another section of code that is getting the object from DragAndDrop.objectReferences, but I’m sure the answer to one is the answer to both.