You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
CrowdControl/Assets/3rd/Plugins/Smart-Inspector/Base/Utils/EditorUtils.cs

24 lines
710 B
C#

1 month ago
using System;
using System.Reflection;
using UnityEditor;
using Object = UnityEngine.Object;
namespace AV.Inspector
{
internal static class EditorUtils
{
static Assembly EditorAssembly { get; } = typeof(Editor).Assembly;
internal static class Presets
{
static Type menuType = EditorAssembly.GetType("UnityEditor.Presets.PresetContextMenu");
static MethodInfo CreateAndShow = menuType.GetMethod("CreateAndShow", BindingFlags.NonPublic | BindingFlags.Static);
public static void ShowMenu(params Object[] targets)
{
CreateAndShow.Invoke(null, new object[] { targets });
}
}
}
}