public static string GetMetadata() { try { var classes = _gameLogicAssembly.GetTypes(); var asmName = _gameLogicAssembly.GetName().Name; return(JsonConvert.SerializeObject( new { Types = classes.Select(t => new { Name = t.FullName.Substring(asmName.Length + 1), Base = t.BaseType.Name, IsManage = t.GetCustomAttribute <ManageTypeAttribute>() != null, ManageClassName = t.GetCustomAttribute <ManageTypeAttribute>()?.CppTypeName ?? "", Propertys = t.GetProperties().Where(PropertyConvert.FilterPropertyForEditor).Select(p => new { Name = p.Name, Type = p.PropertyType.FullName, CanEdit = PropertyConvert.CanEditPropertyInEditor(p), Default = p.GetDefaultValue <object>()?.ToString() ?? "" }) }) })); } catch (Exception e) { Ue.LogError($"Exception:{e}\n{e.StackTrace}"); return(""); } }
public static string GetMetadata() { try { var classes = _gameLogicAssembly.GetTypes().Where(t => t.IsSubclassOf(typeof(UObject))); return(JsonConvert.SerializeObject( new { Types = classes.Select(t => new { Name = t.FullName, Base = t.BaseType.Name, Propertys = t.GetProperties().Where(PropertyConvert.FilterPropertyForEditor).Select(p => new { Name = p.Name, Type = p.PropertyType.FullName, CanEdit = PropertyConvert.CanEditPropertyInEditor(p), Default = p.GetDefaultValue <object>()?.ToString() ?? "" }) }) })); } catch (Exception e) { Ue.LogError($"Exception:{e}\n{e.StackTrace}"); return(""); } }