public Setting(FieldInfo field, SettingType type, string group) { Type = type; Name = field.Name; Group = group; DisplayNameAttribute.GetDisplayName(field, ref DisplayName); HelpTextAttribute.GetHelpText(field, ref HelpText); GroupAttribute.GetGroup(field, ref Group); UseAsShaderConstant = UseAsShaderConstantAttribute.UseFieldAsShaderConstant(field); Visible = VisibleAttribute.IsVisible(field); Editable = EditableAttribute.IsEditable(field); VirtualCode = VirtualSettingAttribute.VirtualSettingCode(field); }
public static bool IsVisible(FieldInfo field) { VisibleAttribute attr = field.GetCustomAttribute <VisibleAttribute>(); if (attr != null) { return(attr.Visible); } else { return(true); } }