private bool CanDrop() { if (m_editor.DragDrop.DragObjects == null || m_editor.DragDrop.DragObjects.Length == 0) { return(false); } IObjectEditorLoader loader = IOC.Resolve <IObjectEditorLoader>(); return(loader.GetObjectType(m_editor.DragDrop.DragObjects[0], typeof(Texture2D)) == typeof(Texture2D)); }
void IPointerEnterHandler.OnPointerEnter(PointerEventData eventData) { if (!Editor.DragDrop.InProgress) { return; } object dragObject = Editor.DragDrop.DragObjects[0]; Type type = m_loader.GetObjectType(dragObject, MemberInfoType); if (type != null && MemberInfoType.IsAssignableFrom(type)) { Editor.DragDrop.Drop -= OnDrop; Editor.DragDrop.Drop += OnDrop; ShowDragHighlight(); Editor.DragDrop.SetCursor(Utils.KnownCursor.DropAllowed); } }