Наследование: System.Attribute
Пример #1
0
 private void createConstantArrayType(FieldUsage usage, FieldInfo field, string methodValue, string globalFieldFormat, string fieldFormat, string constantType, ref string constantTypeProperties, ref string applyGlobalMethodBody, ref string applyInstanceMethodBody, ref string applyInstancingMethodBody)
 {
     if (usage.MaterialUsages == MaterialUsages.Global)
     {
         constantTypeProperties += string.Format(globalFieldFormat, constantType, field.Name, field.Name.ToLower(), usage.MaterialUsages);
         applyGlobalMethodBody  += string.Format(methodValue, field.Name);
     }
     else if (usage.MaterialUsages == MaterialUsages.Instance)
     {
         constantTypeProperties  += string.Format(fieldFormat, constantType, field.Name, field.Name.ToLower(), usage.MaterialUsages);
         applyInstanceMethodBody += string.Format(methodValue, field.Name);
     }
     else if (usage.MaterialUsages == MaterialUsages.Instancing)
     {
         constantTypeProperties    += string.Format(globalFieldFormat, constantType, field.Name, field.Name.ToLower(), usage.MaterialUsages);
         applyInstancingMethodBody += string.Format(methodValue, field.Name);
     }
     else
     {
         throw new Exception("Unsuported MaterialUsages: " + usage.MaterialUsages.ToString());
     }
 }
Пример #2
0
 private void createConstantType(FieldUsage usage, FieldInfo field, string methodValue, string globalFieldFormat, string fieldFormat, string constantType, ref string constantTypeProperties, ref string applyGlobalMethodBody, ref string applyInstanceMethodBody, ref string applyInstancingMethodBody)
 {
     if (usage.MaterialUsages == MaterialUsages.Global)
     {
         constantTypeProperties += string.Format(globalFieldFormat, constantType, field.Name, usage.MaterialUsages);
         applyGlobalMethodBody += string.Format(methodValue, field.Name);
     }
     else if (usage.MaterialUsages == MaterialUsages.Instance)
     {
         constantTypeProperties += string.Format(fieldFormat, constantType, field.Name, usage.MaterialUsages);
         applyInstanceMethodBody += string.Format(methodValue, field.Name);
     }
     else if (usage.MaterialUsages == MaterialUsages.Instancing)
     {
         constantTypeProperties += string.Format(globalFieldFormat, constantType, field.Name, usage.MaterialUsages);
         applyInstancingMethodBody += string.Format(methodValue, field.Name);
     }
     else
     {
         throw new Exception("Unsuported MaterialUsages: " + usage.MaterialUsages.ToString());
     }
 }