- Home /
How to make a drag-drop grid-list of prefabs using custom editor? (to make a tool for game designers)
Hi, I'm trying to create a tool for game designers, which allows them to quickly modify (add/remove items) a grid-list of prefabs, with preview thumbnails, preferably with drag-drop interface.
For example, I want to create a list of monsters which can be spawned in a level, and I need it to display the monster prefabs' thumbnails, and can easily remove/add monsters, so game designers can use it without having to know much about Unity or coding.
I've tried to search for clues but couldn't manage to find much useful information.
What I've learned so far: - I could use GUILayout.SelectionGrid to make a grid-list in custom editor. - I could load prefabs from a path using System.IO.Directory.GetFiles and AssetDatabase.LoadAssetAtPath and get their thumbnails to display using AssetPreview.GetAssetPreview.
What I need to learn: - How to drag prefabs from Project window directly into a SelectionGrid in a custom editor window, to add them to that list. - How to select multiple items in a SelectionGrid, to remove them from that list.
Any help is greatly appreciated. Thank you for your time!