Unity ShaderGUI

1
2
3
4
5
6
7
8
9
10
11
12
13
_materialEditor.TexturePropertySingleLine(Styles.maintexText, _MainTex);
_materialEditor.TextureScaleOffsetProperty(_MainTex);

bool enabled = IsKeywordEnabled(_materialEditor, "Enable_NORMAL");
enabled = ToggleField(Styles.enableNormalText, enabled);

_materialEditor.TexturePropertySingleLine(Styles.normalMapText, _BumpMap, _Bumpness);

if (EditorGUI.EndChangeCheck())
{
SetKeyword(_materialEditor, "Enable_NORMAL", enabled);
return true;
}
分享