|
|
|
|
|
|
|
|
|
|
// We have to check for each layer if the UV2 or UV3 is needed.
|
|
|
|
bool UV2orUV3needed = false; |
|
|
|
for (int layer = 0; layer < numLayer; ++layer) |
|
|
|
{ |
|
|
|
string uvBase = string.Format("{0}{1}", kUVBase, layer); |
|
|
|
string uvDetail = string.Format("{0}{1}", kUVDetail, layer); |
|
|
|
for (int layer = 0; layer < numLayer; ++layer) |
|
|
|
{ |
|
|
|
string uvBase = string.Format("{0}{1}", kUVBase, layer); |
|
|
|
string uvDetail = string.Format("{0}{1}", kUVDetail, layer); |
|
|
|
if ( |
|
|
|
((UVDetailMapping)material.GetFloat(uvDetail) == UVDetailMapping.UV2) || |
|
|
|
((LayerUVBaseMapping)material.GetFloat(uvBase) == LayerUVBaseMapping.UV2) || |
|
|
|
((UVDetailMapping)material.GetFloat(uvDetail) == UVDetailMapping.UV3) || |
|
|
|
((LayerUVBaseMapping)material.GetFloat(uvBase) == LayerUVBaseMapping.UV3) |
|
|
|
if ( |
|
|
|
((UVDetailMapping)material.GetFloat(uvDetail) == UVDetailMapping.UV2) || |
|
|
|
((LayerUVBaseMapping)material.GetFloat(uvBase) == LayerUVBaseMapping.UV2) || |
|
|
|
((UVDetailMapping)material.GetFloat(uvDetail) == UVDetailMapping.UV3) || |
|
|
|
((LayerUVBaseMapping)material.GetFloat(uvBase) == LayerUVBaseMapping.UV3) |
|
|
|
{ |
|
|
|
{ |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
SetKeyword(material, "_REQUIRE_UV2_OR_UV3", UV2orUV3needed); |
|
|
|
} |
|
|
|
|
|
|
LayerUVBaseMapping layerUVBaseMapping = (LayerUVBaseMapping)material.GetFloat(layerUVBaseParam); |
|
|
|
string layerUVDetailParam = string.Format("{0}{1}", kUVDetail, i); |
|
|
|
UVDetailMapping layerUVDetailMapping = (UVDetailMapping)material.GetFloat(layerUVDetailParam); |
|
|
|
string currentLayerMappingTriplanar = string.Format("{0}{1}", kLayerMappingTriplanar, i); |
|
|
|
string currentLayerMappingTriplanar = string.Format("{0}{1}", kLayerMappingTriplanar, i); |
|
|
|
W = (layerUVBaseMapping == LayerUVBaseMapping.UV3) ? 1.0f : 0.0f; |
|
|
|
W = (layerUVBaseMapping == LayerUVBaseMapping.UV3) ? 1.0f : 0.0f; |
|
|
|
layerUVMappingMask[i].colorValue = new Color(X, Y, Z, W); |
|
|
|
layerUVMappingPlanar[i].floatValue = (layerUVBaseMapping == LayerUVBaseMapping.Planar) ? 1.0f : 0.0f; |
|
|
|
|
|
|
|