diff --git a/Editor/ShaderDrawer.cs b/Editor/ShaderDrawer.cs index 77cf54d..140d0e4 100644 --- a/Editor/ShaderDrawer.cs +++ b/Editor/ShaderDrawer.cs @@ -662,8 +662,6 @@ public override void DrawProp(Rect position, MaterialProperty prop, GUIContent l { EditorGUI.showMixedValue = prop.hasMixedValue; var rect = position; - var texLabel = label.text; - // label.text = " "; MaterialProperty extraProp = lwgui.perFrameData.GetProperty(_extraPropName); if (extraProp != null && ( @@ -672,18 +670,20 @@ public override void DrawProp(Rect position, MaterialProperty prop, GUIContent l )) { var i = EditorGUI.indentLevel; - RevertableHelper.FixGUIWidthMismatch(extraProp.type, editor); - EditorGUI.indentLevel += 2; + EditorGUI.indentLevel = 0; + + var extraRect = MaterialEditor.GetRightAlignedFieldRect(rect); + extraRect.height = rect.height; if (extraProp.type == MaterialProperty.PropType.Vector) - _channelDrawer.OnGUI(rect, extraProp, label, editor); + _channelDrawer.OnGUI(extraRect, extraProp, GUIContent.none, editor); else - editor.ShaderProperty(rect, extraProp, label); + editor.ShaderProperty(extraRect, extraProp, GUIContent.none); EditorGUI.indentLevel = i; } - editor.TexturePropertyMiniThumbnail(rect, prop, string.Empty, label.tooltip); + editor.TexturePropertyMiniThumbnail(rect, prop, label.text, label.tooltip); EditorGUI.showMixedValue = false; } diff --git a/Editor/Test/LWGUI_SampleDrawer 2.mat b/Editor/Test/LWGUI_SampleDrawer 2.mat index e801c6d..21e4d31 100644 --- a/Editor/Test/LWGUI_SampleDrawer 2.mat +++ b/Editor/Test/LWGUI_SampleDrawer 2.mat @@ -19,6 +19,14 @@ Material: m_SavedProperties: serializedVersion: 3 m_TexEnvs: + - _AdvancedTex0: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _AdvancedTex1: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} - _Ramp: m_Texture: {fileID: 2800000, guid: df4a1e363556192459af030f3e1d4e89, type: 3} m_Scale: {x: 1, y: 1} @@ -56,6 +64,12 @@ Material: m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} m_Floats: + - _AdvancedRange0: 0.62 + - _Advancedfloat0: 0 + - _Advancedfloat1: 0 + - _Advancedfloat3: 0 + - _Advancedfloat4: 0 + - _Advancedfloat7: 3.21 - _enum: 2 - _float: 0.53 - _float1: 0 @@ -69,6 +83,7 @@ Material: - _group1: 1 - _group2: 0 - _group3: 0 + - _key13_PowerSlider: 0 - _key1_Float1: 0 - _key2_Float2: 0 - _key3_Float3: 0 @@ -86,6 +101,8 @@ Material: - _toggle: 0 - _toggle1: 0 m_Colors: + - _AdvancedColor0: {r: 1, g: 1, b: 1, a: 1} + - _AdvancedColor7: {r: 1, g: 1, b: 1, a: 1} - _color: {r: 1, g: 0, b: 0, a: 1} - _color1: {r: 0.7, g: 0.7, b: 1, a: 1} - _mColor: {r: 1, g: 1, b: 1, a: 1} diff --git a/Editor/Test/SampleDrawer 1.shader b/Editor/Test/SampleDrawer 1.shader index e88aa9e..8fb8094 100644 --- a/Editor/Test/SampleDrawer 1.shader +++ b/Editor/Test/SampleDrawer 1.shader @@ -53,6 +53,7 @@ [Main(Group3, _, on)] _group3 ("Group - Tex and Color Samples", float) = 0 + [Advanced][Tex(Group3)] _tex_single_line ("Tex Single Line", 2D) = "white" { } [Advanced][Tex(Group3, _color)] _tex_color ("Tex with Color", 2D) = "white" { } [Advanced][HideInInspector] _color (" ", Color) = (1, 0, 0, 1) [Advanced][Tex(Group3, _textureChannelMask1)] _tex_channel ("Tex with Channel", 2D) = "white" { } diff --git a/package.json b/package.json index 06e215a..50bb58c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "com.jasonma.lwgui", - "version": "1.14.0", + "version": "1.14.1", "displayName": "LWGUI", "description": "A Lightweight, Flexible, Powerful Shader GUI System for Unity.", "keywords": [