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


C# MaterialEditor.TexturePropertySingleLine方法代码示例

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


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

示例1: ShaderPropertiesGUI

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

            // 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;

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

示例2: 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

示例3: OnGUI

    public override void OnGUI(MaterialEditor materialEditor, MaterialProperty[] props)
    {
        FindProperties (props); // MaterialProperties can be animated so we do not cache them but fetch them every event to ensure animated values are updated correctly

        // Use default labelWidth
        EditorGUIUtility.labelWidth = 0f;

        // Detect any changes to the material
        EditorGUI.BeginChangeCheck();
        {
            GUILayout.Label (Styles.material0Header, EditorStyles.boldLabel);

            // Texture
            materialEditor.TexturePropertySingleLine (Styles.albedo, albedoMap);
            materialEditor.TexturePropertySingleLine (Styles.specular, specularMap);
            materialEditor.TexturePropertySingleLine (Styles.normal, bumpMap);
            materialEditor.TextureScaleOffsetProperty (albedoMap);

            GUILayout.Label (Styles.maskHeader, EditorStyles.boldLabel);

            materialEditor.TexturePropertySingleLine (Styles.blendMask, blendMask);
            materialEditor.TextureScaleOffsetProperty (blendMask);

            GUILayout.Label (Styles.material1Header, EditorStyles.boldLabel);

            materialEditor.TexturePropertySingleLine (Styles.albedo, albedoMap2);
            materialEditor.TexturePropertySingleLine (Styles.specular, specularMap2);
            materialEditor.TexturePropertySingleLine (Styles.normal, bumpMap2);
            materialEditor.TextureScaleOffsetProperty (albedoMap2);
        }
    }
开发者ID:Okacz,项目名称:LQRepo2,代码行数:31,代码来源:TerrainSurfaceGUI.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");
     return EditorGUI.EndChangeCheck();
 }
开发者ID:esther5576,项目名称:SW-game-project,代码行数:9,代码来源:CubemapMaterialEditor.cs

示例5: 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);

            EditorGUILayout.Space();

            materialEditor.ShaderProperty(_emission, "Emission");

            EditorGUILayout.Space();

            materialEditor.ShaderProperty(_randomUV, "Random UV");

            return EditorGUI.EndChangeCheck();
        }
开发者ID:dgkae,项目名称:Teatro,代码行数:42,代码来源:WallMaterialEditor.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: 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

示例9: 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

示例10: ImmediateProperty

 void ImmediateProperty(string name, MaterialEditor materialEditor, MaterialProperty[] props)
 {
     var p = FindProperty(name, props);
     if (p.type == MaterialProperty.PropType.Texture)
         materialEditor.TexturePropertySingleLine(new GUIContent(p.displayName), p);
     else
         materialEditor.ShaderProperty(p, p.displayName);
 }
开发者ID:Clorama,项目名称:My-MA-Final-Project-VR-Game,代码行数:8,代码来源:VolundMultiStandardShaderGUI.cs

示例11: 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

示例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


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