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


C# MaterialEditor.TexturePropertyWithHDRColor方法代码示例

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


在下文中一共展示了MaterialEditor.TexturePropertyWithHDRColor方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: 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


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