We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 693da10 commit 64c42a4Copy full SHA for 64c42a4
Editor/Drawers/ReferenceDrawer.cs
@@ -226,14 +226,21 @@ private void HandleDragPerform()
226
break;
227
case DragAndDropMode.Unity:
228
ModeValue = ReferenceMode.Unity;
229
- PropertyValue = DragAndDrop.objectReferences[0];
+ PropertyValue = GetUnityObject(DragAndDrop.objectReferences[0]);
230
231
case DragAndDropMode.None:
232
default:
233
throw new ArgumentOutOfRangeException();
234
}
235
236
237
+ private Object GetUnityObject(Object objectReference)
238
+ {
239
+ if(objectReference is GameObject gameObject)
240
+ return gameObject.GetComponent(GenericType);
241
+ return objectReference;
242
+ }
243
+
244
protected abstract void PingObject();
245
246
0 commit comments