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); }
public static bool UseFieldAsShaderConstant(FieldInfo field) { UseAsShaderConstantAttribute attr = field.GetCustomAttribute <UseAsShaderConstantAttribute>(); if (attr != null) { return(attr.UseAsShaderConstant); } else { return(true); } }
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); }