From 81130adb1babb42ae22139a5e0af3634fa1d2d1d Mon Sep 17 00:00:00 2001 From: CA-Tatami Date: Tue, 20 Feb 2024 09:36:14 +0900 Subject: [PATCH] =?UTF-8?q?=E3=83=9E=E3=83=86=E3=83=AA=E3=82=A2=E3=83=AB?= =?UTF-8?q?=E3=81=AEMixedValue=E8=A1=A8=E7=A4=BA=E3=81=AE=E5=AF=BE?= =?UTF-8?q?=E5=BF=9C=E3=83=97=E3=83=AD=E3=83=91=E3=83=86=E3=82=A3=E3=81=AE?= =?UTF-8?q?=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Nova/Editor/Core/Scripts/MaterialEditorUtility.cs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/Assets/Nova/Editor/Core/Scripts/MaterialEditorUtility.cs b/Assets/Nova/Editor/Core/Scripts/MaterialEditorUtility.cs index 362320b..45af714 100644 --- a/Assets/Nova/Editor/Core/Scripts/MaterialEditorUtility.cs +++ b/Assets/Nova/Editor/Core/Scripts/MaterialEditorUtility.cs @@ -187,9 +187,11 @@ public static void DrawSmallTexture(MaterialEditor editor, string label, Materia textureRect.width = mapHeight; using (var changeCheckScope = new EditorGUI.ChangeCheckScope()) { + EditorGUI.showMixedValue = textureProp.hasMixedValue; var texture = (Texture)EditorGUI.ObjectField(textureRect, textureProp.textureValue, textureType, false); + EditorGUI.showMixedValue = false; if (changeCheckScope.changed) { editor.RegisterPropertyChangeUndo(textureProp.name); @@ -342,8 +344,10 @@ private static void DrawTexture(MaterialEditor editor, MaterialProperty textureP using (var changeCheckScope = new EditorGUI.ChangeCheckScope()) { + EditorGUI.showMixedValue = textureProperty.hasMixedValue; var texture = (Texture)EditorGUI.ObjectField(textureRect, textureProperty.textureValue, textureType, false); + EditorGUI.showMixedValue = false; if (changeCheckScope.changed) { editor.RegisterPropertyChangeUndo(textureProperty.name); @@ -375,7 +379,6 @@ private static void DrawTexture(MaterialEditor editor, MaterialProperty textureP if (drawTilingAndOffset) using (var changeCheckScope = new EditorGUI.ChangeCheckScope()) { - ; var textureScaleAndOffset = textureProperty.textureScaleAndOffset; var tiling = new Vector2(textureScaleAndOffset.x, textureScaleAndOffset.y); var offset = new Vector2(textureScaleAndOffset.z, textureScaleAndOffset.w); @@ -574,8 +577,9 @@ public static void DrawToggleProperty(MaterialEditor editor, string label, Mater using (var ccs = new EditorGUI.ChangeCheckScope()) { + EditorGUI.showMixedValue = property.hasMixedValue; isOn = EditorGUI.Toggle(rect, isOn); - + EditorGUI.showMixedValue = false; if (ccs.changed) { editor.RegisterPropertyChangeUndo(property.name); @@ -599,7 +603,9 @@ public static void DrawVector2Property(MaterialEditor editor, string label, Mate using (var ccs = new EditorGUI.ChangeCheckScope()) { + EditorGUI.showMixedValue = property.hasMixedValue; value = EditorGUI.Vector2Field(rect, string.Empty, value); + EditorGUI.showMixedValue = false; if (ccs.changed) {