- Home /
Question by
squid808 · Nov 07, 2012 at 08:06 PM ·
c#editordrag and drop
Custom editor field accepting multiple drag and drops?
I have a custom editor I'm using for a custom object. Right now I can drag an object into that field and immediately add it to a list as so:
customObject = EditorGUILayout.ObjectField("Drag Element Here to Add",
customObject, typeof(Element), false) as Element;
if (customObject != null) {
if (!objectList.Contains(customObject)) {
objectList.Add(customObject);
customObject = null;
} else {
Debug.Log(customObject.name + " is already in the list.");
customObject = null;
}
}
I can't seem to drag and drop more than one thing in, no matter what I've tried (like using a list customObject instead of just a single object), but I've seen it done (for instance with 2dTK). How?
Comment
Answer by Demigiant · Nov 07, 2012 at 09:06 PM
tk2d uses a custom drag and drop area, not an objectField. You should look for DragAndDrop operations.
Your answer
