public List<Command> Info()
{
var types = Assembly.GetCallingAssembly().GetTypes();
var cType = typeof(Command);
List<Command> cList = new List<Command>();
foreach (var type in types)
{
var baseType = type.BaseType; //获取基类
while (baseType != null) //获取所有基类
{
Debug.Log(baseType.Name);
if (baseType.Name == cType.Name)
{
System.Type objtype = System.Type.GetType(type.FullName, true);
object obj = System.Activator.CreateInstance(objtype);
if (obj != null)
{
Command info = obj as Command;
cList.Add(info);
}
break;
}
else
{
baseType = baseType.BaseType;
}
}
}
return cList;
}