本文整理汇总了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();
}
示例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();
}