UnitySerializedReferenceUI/Assets/TextusGames/Enhancements/SerializeReferenceUI/Drawing/SerializeReferenceInspectorMiddleMouseMenu.cs
TextusGames 0581978db8 FIrst Real Commit
Code refactor and migration to github.
2020-05-16 16:17:04 +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