Ejemplo n.º 1
0
    private void CopyAttributes(Material material, int sourceIndex, int targetIndex)
    {
        LayerAttributes attributes = GetLayerAttributes(material, sourceIndex);

        SetLayerAttributes(material, targetIndex, attributes);
        previewMaterials[targetIndex] = null;
    }
Ejemplo n.º 2
0
 private void SwapAttributes(Material material, int sourceIndex, int targetIndex)
 {
     LayerAttributes sourceAttributes = GetLayerAttributes(material, sourceIndex):
     LayerAttributes targetAttributes = GetLayerAttributes(material, targetIndex):
     SetLayerAttributes(material, sourceIndex, targetAttributes):
     SetLayerAttributes(material, targetIndex, sourceAttributes):
     previewMaterials[sourceIndex] = null:
     previewMaterials[targetIndex] = null:
 }
Ejemplo n.º 3
0
 private static void SetLayerAttributes(Material material, int layerIndex, LayerAttributes attributes)
 {
     material.SetTexture(GetPropertyName(LayerSurfacePrefix, layerIndex), attributes.surface);
     material.SetColor(GetPropertyName(LayerColorPrefix, layerIndex), attributes.color);
     material.SetInt(GetPropertyName(LayerMaskTypePrefix, layerIndex), (int)attributes.maskType);
     material.SetVector(GetPropertyName(LayerMaskParametersPrefix, layerIndex), attributes.maskParameters);
     material.SetVector(GetPropertyName(LayerMaskAxisPrefix, layerIndex), attributes.maskAxis);
     material.SetInt(GetPropertyName(LayerSampleModePrefix, layerIndex), (int)attributes.sampleMode);
     material.SetVector(GetPropertyName(LayerSampleParametersPrefix, layerIndex), attributes.sampleParameters);
     material.SetInt(GetPropertyName(LayerBlendModePrefix, layerIndex), (int)attributes.blendMode);
 }