UnitySerializedReferenceUI/Assets/Textus/SerializeReferenceUI/DefaultUI/SerializeReferenceInspectorMiddleMouseMenu.cs
TextusGames eeaadfc569 Major refactor.
Core now formed and contains all useful utility to create custom ui with restrictions.
Many methods was extracted from different classes and moved to core.

Undo is now supported(because unity's undo bug seems to be fixed).

Example now moved into same level separate folder.
2020-05-16 20:15:24 +03:00

21 lines
597 B
C#

#if UNITY_EDITOR
using System;
using System.Collections.Generic;
using UnityEditor;
using UnityEngine;
public static class SerializeReferenceInspectorMiddleMouseMenu
{
public static void ShowContextMenuForManagedReferenceOnMouseMiddleButton(this SerializedProperty property,
Rect position, IEnumerable<Func<Type, bool>> filters = null)
{
var e = Event.current;
if (e.type != EventType.MouseDown || !position.Contains(e.mousePosition) || e.button != 2)
return;
property.ShowContextMenuForManagedReference(filters);
}
}
#endif