本文整理匯總了C#中UnityEditor.MaterialEditor.TexturePropertyTwoLines方法的典型用法代碼示例。如果您正苦於以下問題:C# MaterialEditor.TexturePropertyTwoLines方法的具體用法?C# MaterialEditor.TexturePropertyTwoLines怎麽用?C# MaterialEditor.TexturePropertyTwoLines使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類UnityEditor.MaterialEditor
的用法示例。
在下文中一共展示了MaterialEditor.TexturePropertyTwoLines方法的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();
}