ProjectDDD/Packages/SLUnity/Editor/SLUI/SLUIUtil.cs

27 lines
859 B
C#
Raw Normal View History

using System.Collections.Generic;
using System.Linq;
using System.Reflection;
namespace Superlazy.UI
{
public static class SLUIEditorUtil
{
public static string[] GetAllCommands()
{
var methods = new Dictionary<string, Dictionary<string, MethodInfo>>();
methods.CreateMethodInfoDictionary<SLGameComponent>(false, typeof(SLEntity));
var components = new List<SLGameComponent>();
components.CreateInstanceList();
var commands = new Dictionary<string, (SLGameComponent manager, MethodInfo method)>();
commands.Add("None", (null, null));
foreach (var component in components)
{
commands.CreateCommandInfoToBaseType(component, typeof(SLEntity));
}
return commands.Keys.ToArray();
}
}
}