예제 #1
0
 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);
 }
예제 #2
0
파일: Attributes.cs 프로젝트: uhacz/bitbox
        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);
 }