#798 build.cs里使用反射查询字段的存在性   C#     module     snippets     UE4     4 months ago (owner) Document
private bool FindProperty(string ProName)
{
    Type type = typeof(ModuleRules); // 替换YourClass为具体的类名
    PropertyInfo[] properties = type.GetProperties();
    foreach (PropertyInfo property in properties)
    {
        if (property.Name == ProName)
        {
            PropertyInfo FoundProperty = type.GetProperty(ProName);
            FoundProperty.SetValue(this, WarningLevel.Off);
            return true;
        }
    }
    return false;
}