当前位置: 首页>>代码示例>>C#>>正文


C# MaterialEditor.ShaderProperty方法代码示例

本文整理汇总了C#中UnityEditor.MaterialEditor.ShaderProperty方法的典型用法代码示例。如果您正苦于以下问题:C# MaterialEditor.ShaderProperty方法的具体用法?C# MaterialEditor.ShaderProperty怎么用?C# MaterialEditor.ShaderProperty使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在UnityEditor.MaterialEditor的用法示例。


在下文中一共展示了MaterialEditor.ShaderProperty方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: DrawLayer

   void DrawLayer(MaterialEditor editor, int i, MaterialProperty[] props, string[] keyWords, Workflow workflow, 
      bool hasGloss, bool hasSpec, bool isParallax, bool hasEmis, bool hasDistBlend)
   {
      EditorGUIUtility.labelWidth = 0f;
      var albedoMap = FindProperty ("_Tex" + i, props);
      var tint = FindProperty("_Tint" + i, props);
      var normalMap = FindProperty ("_Normal" + i, props);
      var smoothness = FindProperty("_Glossiness" + i, props);
      var glossinessMap = FindProperty("_GlossinessTex" + i, props, false);
      var metallic = FindProperty("_Metallic" + i, props, false);
      var emissionTex = FindProperty("_Emissive" + i, props);
      var emissionMult = FindProperty("_EmissiveMult" + i, props);
      var parallax = FindProperty("_Parallax" + i, props);
      var texScale = FindProperty("_TexScale" + i, props);
      var specMap = FindProperty("_SpecGlossMap" + i, props, false);
      var specColor = FindProperty("_SpecColor" + i, props, false);
      var distUVScale = FindProperty("_DistUVScale" + i, props, false);

      editor.TexturePropertySingleLine(new GUIContent("Albedo/Height"), albedoMap);
      editor.ShaderProperty(tint, "Tint");
      editor.TexturePropertySingleLine(new GUIContent("Normal"), normalMap);
      if (workflow == Workflow.Metallic)
      {
         editor.TexturePropertySingleLine(new GUIContent("Metal(R)/Smoothness(A)"), glossinessMap);
      }
      else
      {
         editor.TexturePropertySingleLine(new GUIContent("Specular(RGB)/Gloss(A)"), specMap);
      }
      if (workflow == Workflow.Metallic && !hasGloss)
      { 
         editor.ShaderProperty(smoothness, "Smoothness");
         editor.ShaderProperty(metallic, "Metallic");
      }
      else if (workflow == Workflow.Specular && !hasSpec)
      {
         editor.ShaderProperty(smoothness, "Smoothness");
         editor.ShaderProperty(specColor, "Specular Color");
      }
      editor.TexturePropertySingleLine(new GUIContent("Emission"), emissionTex);
      editor.ShaderProperty(emissionMult, "Emissive Multiplier");

      editor.ShaderProperty(texScale, "Texture Scale");
      if (hasDistBlend)
      {
         editor.ShaderProperty(distUVScale, "Distance UV Scale");
      }
      if (isParallax)
      {
         editor.ShaderProperty(parallax, "Parallax Height");
      }

      if (i != 1)
      {
         editor.ShaderProperty(FindProperty("_Contrast"+i, props), "Interpolation Contrast");
      }
   }
开发者ID:ArieLeo,项目名称:VertexPaint,代码行数:57,代码来源:SplatMapShaderGUI.cs

示例2: ShaderPropertiesGUI

 bool ShaderPropertiesGUI(MaterialEditor materialEditor)
 {
     EditorGUI.BeginChangeCheck();
     materialEditor.TexturePropertySingleLine(_textCubemap, _cubemap, _tint);
     Vector3Property(materialEditor, _euler, "Rotation");
     materialEditor.ShaderProperty(_exposure, "Exposure");
     materialEditor.ShaderProperty(_saturation, "Saturation");
     return EditorGUI.EndChangeCheck();
 }
开发者ID:esther5576,项目名称:SW-game-project,代码行数:9,代码来源:CubemapMaterialEditor.cs

示例3: ShaderPropertiesGUI

        bool ShaderPropertiesGUI(MaterialEditor materialEditor)
        {
            EditorGUI.BeginChangeCheck();

            materialEditor.ShaderProperty(_colorMode, "Color Mode");

            if (_colorMode.floatValue > 0)
            {
                var rect = EditorGUILayout.GetControlRect();
                rect.x += EditorGUIUtility.labelWidth;
                rect.width = (rect.width - EditorGUIUtility.labelWidth) / 2 - 2;
                materialEditor.ShaderProperty(rect, _color, "");
                rect.x += rect.width + 4;
                materialEditor.ShaderProperty(rect, _color2, "");
            }
            else
            {
                materialEditor.ShaderProperty(_color, " ");
            }

            EditorGUILayout.Space();

            materialEditor.ShaderProperty(_metallic, "Metallic");
            materialEditor.ShaderProperty(_smoothness, "Smoothness");

            EditorGUILayout.Space();

            materialEditor.TexturePropertySingleLine(_albedoText, _albedoMap, null);
            materialEditor.TexturePropertySingleLine(_normalMapText, _normalMap, _normalMap.textureValue ? _normalScale : null);
            materialEditor.TexturePropertySingleLine(_occlusionText, _occlusionMap, _occlusionMap.textureValue ? _occlusionStr : null);
            materialEditor.TextureScaleOffsetProperty(_albedoMap);

            return EditorGUI.EndChangeCheck();
        }
开发者ID:Zero-Ax,项目名称:Mouse-position-Drag,代码行数:34,代码来源:SpraySurfaceMaterialEditor.cs

示例4: ShaderPropertiesGUI

        bool ShaderPropertiesGUI(MaterialEditor materialEditor)
        {
            EditorGUI.BeginChangeCheck();

            materialEditor.TexturePropertySingleLine(_textCubemap, _cubemap, _tint);
            Vector3Property(materialEditor, _euler, "Rotation");
            materialEditor.ShaderProperty(_exposure, "Exposure");
            materialEditor.ShaderProperty(_saturation, "Saturation");

            materialEditor.ShaderProperty(_lod, "Specify MIP Level");
            if (_lod.hasMixedValue || _lod.floatValue > 0)
            {
                EditorGUI.indentLevel++;
                materialEditor.ShaderProperty(_lodLevel, "Level");
                EditorGUI.indentLevel--;
            }

            return EditorGUI.EndChangeCheck();
        }
开发者ID:VladimirStefaniuk,项目名称:SkyboxPlus,代码行数:19,代码来源:CubemapMaterialEditor.cs

示例5: ShaderPropertiesGUI

        bool ShaderPropertiesGUI(MaterialEditor materialEditor)
        {
            EditorGUI.BeginChangeCheck();

            materialEditor.ShaderProperty(_blendMode, "Blend Mode");
            materialEditor.ShaderProperty(_colorMode, "Color Mode");

            if (_colorMode.floatValue > 0)
            {
                var rect = EditorGUILayout.GetControlRect();
                rect.x += EditorGUIUtility.labelWidth;
                rect.width = (rect.width - EditorGUIUtility.labelWidth) / 2 - 2;
                materialEditor.ShaderProperty(rect, _color, "");
                rect.x += rect.width + 4;
                materialEditor.ShaderProperty(rect, _color2, "");
            }
            else
            {
                materialEditor.ShaderProperty(_color, " ");
            }

            materialEditor.ShaderProperty(_mainTex, "Texture");

            return EditorGUI.EndChangeCheck();
        }
开发者ID:Zero-Ax,项目名称:Mouse-position-Drag,代码行数:25,代码来源:SprayUnlitMaterialEditor.cs

示例6: ShaderPropertiesGUI

	bool ShaderPropertiesGUI(MaterialEditor materialEditor)
	{
		EditorGUI.BeginChangeCheck();

		materialEditor.TexturePropertySingleLine(_albedoText, _albedoMap, _albedoColor);
		materialEditor.ShaderProperty(_metallic, "Metallic");
		materialEditor.ShaderProperty(_smoothness, "Smoothness");

        EditorGUILayout.Space();

        materialEditor.TexturePropertySingleLine(_normalMapText, _bumpMap, null);

        EditorGUILayout.Space();

		materialEditor.TexturePropertySingleLine(_occlusionText, _occlusionMap, _occlusionMap.textureValue ? _occlusionStrength : null);

        EditorGUILayout.Space();

		materialEditor.ShaderProperty(_mapScale, "Mapping Scale");

        return EditorGUI.EndChangeCheck();
    }
开发者ID:yyzreal,项目名称:TriplanarPBS,代码行数:22,代码来源:TriplanarPBSGUI.cs

示例7: ShaderPropertiesGUI

        bool ShaderPropertiesGUI(MaterialEditor materialEditor)
        {
            EditorGUI.BeginChangeCheck();

            materialEditor.ShaderProperty(_color, "Color");
            materialEditor.ShaderProperty(_metallic, "Metallic");
            materialEditor.ShaderProperty(_smoothness, "Smoothness");

            EditorGUILayout.Space();

            materialEditor.TexturePropertySingleLine(_albedoText, _albedoMap, null);

            var scale = _normalMap.textureValue ? _normalScale : null;
            materialEditor.TexturePropertySingleLine(_normalMapText, _normalMap, scale);

            var str = _occlusionMap.textureValue ? _occlusionStr : null;
            materialEditor.TexturePropertySingleLine(_occlusionText, _occlusionMap, str);

            if (_albedoMap.textureValue || _normalMap.textureValue || _occlusionMap.textureValue)
                materialEditor.ShaderProperty(_mapScale, "Scale");

            return EditorGUI.EndChangeCheck();
        }
开发者ID:rodrycode,项目名称:KvantTunnel,代码行数:23,代码来源:TunnelMaterialEditor.cs

示例8: DoKeyword

        protected bool DoKeyword(MaterialEditor _editor, MaterialProperty _prop, string _desc)
        {
            string _keyword;
            if (!m_Keywords.TryGetValue (_prop.name, out _keyword))
                return false;

            _editor.ShaderProperty(_prop, _desc);

            bool _on = _prop.floatValue > 0;

            var _mtl = _editor.target as Material;

            if (_on)
                _mtl.EnableKeyword(_keyword);
            else
                _mtl.DisableKeyword(_keyword);

            return _on;
        }
开发者ID:ming4883,项目名称:mud,代码行数:19,代码来源:ShaderGUIBase.cs

示例9: ShaderPropertiesGUI

        bool ShaderPropertiesGUI(MaterialEditor materialEditor)
        {
            EditorGUI.BeginChangeCheck();

            materialEditor.ShaderProperty(_baseColor, "Base Color");
            materialEditor.ShaderProperty(_exposure, "Exposure");

            EditorGUILayout.Space();
            EditorGUILayout.LabelField("Gradient 1");
            Vector3Property(materialEditor, _direction1, "Direction");
            materialEditor.ShaderProperty(_color1, "Color");
            materialEditor.ShaderProperty(_exponent1, "Exponent");
            EditorGUILayout.Space();

            materialEditor.ShaderProperty(_switch2, "Gradient 2");
            if (_switch2.floatValue > 0)
            {
                Vector3Property(materialEditor, _direction2, "Direction");
                materialEditor.ShaderProperty(_color2, "Color");
                materialEditor.ShaderProperty(_exponent2, "Exponent");
                EditorGUILayout.Space();
            }

            materialEditor.ShaderProperty(_switch3, "Gradient 3");
            if (_switch3.floatValue > 0)
            {
                Vector3Property(materialEditor, _direction3, "Direction");
                materialEditor.ShaderProperty(_color3, "Color");
                materialEditor.ShaderProperty(_exponent3, "Exponent");
                EditorGUILayout.Space();
            }

            materialEditor.ShaderProperty(_switch4, "Gradient 4");
            if (_switch4.floatValue > 0)
            {
                Vector3Property(materialEditor, _direction4, "Direction");
                materialEditor.ShaderProperty(_color4, "Color");
                materialEditor.ShaderProperty(_exponent4, "Exponent");
            }

            return EditorGUI.EndChangeCheck();
        }
开发者ID:dgkae,项目名称:Teatro,代码行数:42,代码来源:GradientsMaterialEditor.cs

示例10: DoGeneral

        private void DoGeneral(MaterialEditor _materialEditor)
        {
            if (!BeginGroup("General"))
                return;

            _materialEditor.ShaderProperty(m_FadeOut, "Fade Out");

            _materialEditor.TextureProperty(m_BayerTex, "Differ Matrix");

            _materialEditor.TextureProperty(m_MainTex, "Main Texture (RGBA)");

            if (DoKeyword(_materialEditor, m_DimOn, "Use Dim Texture"))
            {
                _materialEditor.TextureProperty(m_DimTex, "Dim Texture (RGB)");
            }

            _materialEditor.TextureProperty(m_DiffuseLUTTex, "Diffuse LUT");

            _materialEditor.TextureProperty(m_SpecularLUTTex, "Specular LUT");

            EndGroup();
        }
开发者ID:ming4883,项目名称:mud,代码行数:22,代码来源:NPRHairUI.cs

示例11: DrawLayer

   void DrawLayer(MaterialEditor editor, int i, MaterialProperty[] props, string[] keyWords, bool hasGloss, bool isParallax, bool hasEmis)
   {
      EditorGUIUtility.labelWidth = 0f;
      var albedoMap = FindProperty ("_Tex" + i, props);
      var normalMap = FindProperty ("_Normal" + i, props);
      var smoothness = FindProperty("_Glossiness" + i, props);
      var glossinessMap = FindProperty("_GlossinessTex" + i, props);
      var metallic = FindProperty("_Metallic" + i, props);
      var emissionTex = FindProperty("_Emissive" + i, props);
      var emissionMult = FindProperty("_EmissiveMult" + i, props);
      var parallax = FindProperty("_Parallax" + i, props);
      var texScale = FindProperty("_TexScale" + i, props);

      //editor.TexturePropertySingleLine("Albedo (RGB) Height (A)", albedoMap);
      editor.TexturePropertySingleLine(new GUIContent("Albedo/Height"), albedoMap);
      editor.TexturePropertySingleLine(new GUIContent("Normal"), normalMap);
      editor.TexturePropertySingleLine(new GUIContent("Metal(R)/Smoothness(A)"), glossinessMap);
      if (!hasGloss)
      { 
         editor.ShaderProperty(smoothness, "Smoothness");
         editor.ShaderProperty(metallic, "Metallic");
      }
      editor.TexturePropertySingleLine(new GUIContent("Emission"), emissionTex);
      editor.ShaderProperty(emissionMult, "Emissive Multiplier");

      editor.ShaderProperty(texScale, "Texture Scale");

      if (isParallax)
      {
         editor.ShaderProperty(parallax, "Parallax Height");
      }

      if (i != 1)
      {
         editor.ShaderProperty(FindProperty("_Contrast"+i, props), "Interpolation Contrast");
      }
   }
开发者ID:cupsster,项目名称:VertexPaint,代码行数:37,代码来源:SplatMapShaderGUI.cs

示例12: ImmediateProperty

 bool ImmediateProperty(string name, MaterialEditor materialEditor, MaterialProperty[] props)
 {
     EditorGUI.BeginChangeCheck();
     var p = FindProperty(name, props);
     if(p.type == MaterialProperty.PropType.Texture)
     materialEditor.TexturePropertySingleLine(new GUIContent(p.displayName), p);
     else
     materialEditor.ShaderProperty(p, p.displayName);
     return EditorGUI.EndChangeCheck();
 }
开发者ID:CG-F15-6-Rutgers,项目名称:UnityProjects,代码行数:10,代码来源:VolundMultiStandardShaderGUI.cs

示例13: ShaderPropertiesGUI

        bool ShaderPropertiesGUI(MaterialEditor materialEditor)
        {
            EditorGUI.BeginChangeCheck();

            EditorGUILayout.LabelField("Front-face properties", EditorStyles.boldLabel);

            EditorGUILayout.Space();

            // albedo
            materialEditor.TexturePropertySingleLine(_albedoText, _mainTex, _color);

            // metallic / smoothness
            if (_metallicGlossMap.textureValue == null)
                materialEditor.TexturePropertyTwoLines(_metallicText, _metallicGlossMap, _metallic, _smoothnessText, _glossiness);
            else
                materialEditor.TexturePropertySingleLine(_metallicText, _metallicGlossMap);

            // normal map
            materialEditor.TexturePropertySingleLine(_normalMapText, _bumpMap, _bumpMap.textureValue != null ? _bumpScale : null);

            // occlusion
            materialEditor.TexturePropertySingleLine(_occlusionText, _occlusionMap, _occlusionMap.textureValue != null ? _occlusionStrength : null);

            // emission
            bool hadEmissionTexture = _emissionMap.textureValue != null;
            materialEditor.TexturePropertyWithHDRColor(_emissionText, _emissionMap, _emissionColor, _colorPickerHDRConfig, false);

            // if texture was assigned and color was black set color to white
            if (_emissionMap.textureValue != null && !hadEmissionTexture)
                if (_emissionColor.colorValue.maxColorComponent <= 0)
                    _emissionColor.colorValue = Color.white;

            EditorGUILayout.Space();

            // backface properties
            EditorGUILayout.LabelField("Back-face properties", EditorStyles.boldLabel);

            EditorGUILayout.Space();

            materialEditor.ShaderProperty(_backColor, "Color");
            materialEditor.ShaderProperty(_backMetallic, "Matallic");
            materialEditor.ShaderProperty(_backGlossiness, "Smoothness");

            return EditorGUI.EndChangeCheck();
        }
开发者ID:aleaverin,项目名称:SpektrScatter,代码行数:45,代码来源:ScatterStandardMaterialEditor.cs

示例14: DoGeneral

        private void DoGeneral(MaterialEditor _materialEditor)
        {
            if (!BeginGroup("General"))
                return;

            _materialEditor.TextureProperty(m_MainTex, "Main Texture (RGB)");

            _materialEditor.TextureProperty(m_BayerTex, "Differ Matrix");

            _materialEditor.ShaderProperty(m_FadeOut, "Fade Out");

            DoKeyword(_materialEditor, m_TextureFadeOutOn, "Fade Out (Tex Alpha)");

            if (DoKeyword(_materialEditor, m_IrradianceOn, "Use Irradiance"))
            {
                _materialEditor.ShaderProperty(m_IrradianceBoost, "Irradiance Boost");
            }

            DoKeyword(_materialEditor, m_DarkenBackfacesOn, "Use Darken Backfaces");

            if (DoKeyword (_materialEditor, m_DimOn, "Use Dim Texture"))
            {
                _materialEditor.TextureProperty (m_DimTex, "Dim Texture (RGB)");
            }

            EndGroup();
        }
开发者ID:ming4883,项目名称:mud,代码行数:27,代码来源:NPRCelShadingUI.cs

示例15: DoRim

        private void DoRim(MaterialEditor _materialEditor)
        {
            if (!BeginGroup("Rim"))
                return;

            if (DoKeyword(_materialEditor, m_RimOn, "Use Rim"))
            {
                _materialEditor.ShaderProperty(m_RimLUTTex, "Rim LUT (Grayscale)");
                _materialEditor.ShaderProperty(m_RimIntensity, "Rim Intensity");
            }

            EndGroup();
        }
开发者ID:ming4883,项目名称:mud,代码行数:13,代码来源:NPRCelShadingUI.cs


注:本文中的UnityEditor.MaterialEditor.ShaderProperty方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。