@@ -34,77 +34,73 @@ public class BodyMaterialSetter : BaseMaterialSetter
3434
3535 protected override IEnumerable < ( string , TextureJsonData ) > ApplyTextures ( IReadOnlyDictionary < string , TextureJsonData > textures )
3636 {
37- yield return ( "_MainTex" , textures [ "_MainTex" ] ) ;
38- yield return ( "_LightMap" , textures [ "_LightMap" ] ) ;
39- yield return ( "_RampMapWarm" , textures [ "_DiffuseRampMultiTex" ] ) ;
40- yield return ( "_RampMapCool" , textures [ "_DiffuseCoolRampMultiTex" ] ) ;
37+ yield return MakeProperty ( "_MainTex" , textures ) ;
38+ yield return MakeProperty ( "_LightMap" , textures ) ;
39+ yield return MakeProperty ( "_RampMapWarm" , textures , "_DiffuseRampMultiTex" ) ;
40+ yield return MakeProperty ( "_RampMapCool" , textures , "_DiffuseCoolRampMultiTex" ) ;
4141
42- yield return ( "_StockingsMap" , textures [ "_StockRangeTex" ] ) ;
42+ yield return MakeProperty ( "_StockingsMap" , textures , "_StockRangeTex" ) ;
4343 }
4444
4545 protected override IEnumerable < ( string , float ) > ApplyFloats ( IReadOnlyDictionary < string , float > floats )
4646 {
47- // yield return ("_Cull", floats[ "_CullMode"] );
47+ // yield return MakeProperty ("_Cull", floats, "_CullMode");
4848
4949 // TODO Float 某些值不准,比如 _SrcBlend 和 _DstBlend
50- // yield return ("_SrcBlendColor", floats[ "_SrcBlend"] );
51- // yield return ("_DstBlendColor", floats[ "_DstBlend"] );
50+ // yield return MakeProperty ("_SrcBlendColor", floats, "_SrcBlend");
51+ // yield return MakeProperty ("_DstBlendColor", floats, "_DstBlend");
5252
53- yield return ( "_AlphaTest" , floats [ "_EnableAlphaCutoff" ] ) ;
54- yield return ( "_AlphaTestThreshold" , floats [ "_AlphaCutoff" ] ) ;
53+ yield return MakeProperty ( "_AlphaTest" , floats , "_EnableAlphaCutoff" ) ;
54+ yield return MakeProperty ( "_AlphaTestThreshold" , floats , "_AlphaCutoff" ) ;
5555
56- yield return ( "_EmissionThreshold" , floats [ "_EmissionThreshold" ] ) ;
57- yield return ( "_EmissionIntensity" , floats [ "_EmissionIntensity" ] ) ;
56+ yield return MakeProperty ( "_EmissionThreshold" , floats ) ;
57+ yield return MakeProperty ( "_EmissionIntensity" , floats ) ;
5858
59- yield return ( "_RimShadowCt" , floats [ "_RimShadowCt" ] ) ;
60- yield return ( "_RimShadowIntensity" , floats [ "_RimShadowIntensity" ] ) ;
59+ yield return MakeProperty ( "_RimShadowCt" , floats ) ;
60+ yield return MakeProperty ( "_RimShadowIntensity" , floats ) ;
6161
6262 for ( int i = 0 ; i <= 7 ; i ++ )
6363 {
64- yield return ( $ "_SpecularIntensity{ i } ", floats [ $ "_SpecularIntensity { i } " ] ) ;
65- yield return ( $ "_SpecularShininess{ i } ", floats [ $ "_SpecularShininess { i } " ] ) ;
66- yield return ( $ "_SpecularRoughness{ i } ", floats [ $ "_SpecularRoughness { i } " ] ) ;
64+ yield return MakeProperty ( $ "_SpecularIntensity{ i } ", floats ) ;
65+ yield return MakeProperty ( $ "_SpecularShininess{ i } ", floats ) ;
66+ yield return MakeProperty ( $ "_SpecularRoughness{ i } ", floats ) ;
6767
68- yield return ( $ "_RimShadowWidth{ i } ", floats [ $ "_RimShadowWidth { i } " ] ) ;
69- yield return ( $ "_RimShadowFeather{ i } ", floats [ $ "_RimShadowFeather { i } " ] ) ;
68+ yield return MakeProperty ( $ "_RimShadowWidth{ i } ", floats ) ;
69+ yield return MakeProperty ( $ "_RimShadowFeather{ i } ", floats ) ;
7070
71- yield return ( $ "_mmBloomIntensity{ i } ", floats [ $ "_mBloomIntensity{ i } "] ) ;
71+ yield return MakeProperty ( $ "_mmBloomIntensity{ i } ", floats , $ "_mBloomIntensity{ i } ") ;
7272 }
7373
7474 // Stockings
75- yield return ( "_StockingsDarkWidth" , floats [ "_StockDarkWidth" ] ) ;
76- yield return ( "_StockingsPower" , floats [ "_Stockpower" ] ) ;
77- yield return ( "_StockingsLightedWidth" , floats [ "_Stockpower1" ] ) ;
78- yield return ( "_StockingsLightedIntensity" , floats [ "_StockSP" ] ) ;
79- yield return ( "_StockingsRoughness" , floats [ "_StockRoughness" ] ) ;
75+ yield return MakeProperty ( "_StockingsDarkWidth" , floats , "_StockDarkWidth" ) ;
76+ yield return MakeProperty ( "_StockingsPower" , floats , "_Stockpower" ) ;
77+ yield return MakeProperty ( "_StockingsLightedWidth" , floats , "_Stockpower1" ) ;
78+ yield return MakeProperty ( "_StockingsLightedIntensity" , floats , "_StockSP" ) ;
79+ yield return MakeProperty ( "_StockingsRoughness" , floats , "_StockRoughness" ) ;
8080 }
8181
8282 protected override IEnumerable < ( string , Color ) > ApplyColors ( IReadOnlyDictionary < string , Color > colors )
8383 {
84- yield return ( "_Color" , colors [ "_Color" ] ) ;
85- yield return ( "_BackColor" , colors [ "_BackColor" ] ) ;
86- yield return ( "_EmissionColor" , colors [ "_EmissionTintColor" ] ) ;
87- yield return ( "_RimShadowOffset" , colors [ "_RimShadowOffset" ] ) ;
84+ yield return MakeProperty ( "_Color" , colors ) ;
85+ yield return MakeProperty ( "_BackColor" , colors ) ;
86+ yield return MakeProperty ( "_EmissionColor" , colors , "_EmissionTintColor" ) ;
87+ yield return MakeProperty ( "_RimShadowOffset" , colors ) ;
8888
8989 for ( int i = 0 ; i <= 7 ; i ++ )
9090 {
91- yield return ( $ "_SpecularColor{ i } ", colors [ $ "_SpecularColor{ i } "] ) ;
92- yield return ( $ "_RimColor{ i } ", colors [ $ "_RimColor{ i } "] ) ;
93- yield return ( $ "_RimShadowColor{ i } ", colors [ $ "_RimShadowColor{ i } "] ) ;
94- yield return ( $ "_OutlineColor{ i } ", colors [ $ "_OutlineColor{ i } "] ) ;
95-
96- if ( colors . TryGetValue ( $ "_mBloomColor{ i } ", out Color bloomColor ) )
97- {
98- yield return ( $ "_BloomColor{ i } ", bloomColor ) ;
99- }
91+ yield return MakeProperty ( $ "_SpecularColor{ i } ", colors ) ;
92+ yield return MakeProperty ( $ "_RimColor{ i } ", colors ) ;
93+ yield return MakeProperty ( $ "_RimShadowColor{ i } ", colors ) ;
94+ yield return MakeProperty ( $ "_OutlineColor{ i } ", colors ) ;
95+ yield return MakeProperty ( $ "_BloomColor{ i } ", colors , $ "_mBloomColor{ i } ") ;
10096 }
10197
10298 // Texture Scale Offset
103- yield return ( "_Maps_ST" , colors [ "_MainMaps_ST" ] ) ;
99+ yield return MakeProperty ( "_Maps_ST" , colors , "_MainMaps_ST" ) ;
104100
105101 // Stockings
106- yield return ( "_StockingsColor" , colors [ "_Stockcolor" ] ) ;
107- yield return ( "_StockingsColorDark" , colors [ "_StockDarkcolor" ] ) ;
102+ yield return MakeProperty ( "_StockingsColor" , colors , "_Stockcolor" ) ;
103+ yield return MakeProperty ( "_StockingsColorDark" , colors , "_StockDarkcolor" ) ;
108104 }
109105 }
110106}
0 commit comments