summaryrefslogtreecommitdiff
path: root/Assets/ThirdParty/AmplifyShaderEditor/Plugins/Editor/CustomDrawers/SingleLineTexture.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Assets/ThirdParty/AmplifyShaderEditor/Plugins/Editor/CustomDrawers/SingleLineTexture.cs')
-rw-r--r--Assets/ThirdParty/AmplifyShaderEditor/Plugins/Editor/CustomDrawers/SingleLineTexture.cs23
1 files changed, 23 insertions, 0 deletions
diff --git a/Assets/ThirdParty/AmplifyShaderEditor/Plugins/Editor/CustomDrawers/SingleLineTexture.cs b/Assets/ThirdParty/AmplifyShaderEditor/Plugins/Editor/CustomDrawers/SingleLineTexture.cs
new file mode 100644
index 00000000..b2d6754e
--- /dev/null
+++ b/Assets/ThirdParty/AmplifyShaderEditor/Plugins/Editor/CustomDrawers/SingleLineTexture.cs
@@ -0,0 +1,23 @@
+// Amplify Shader Editor - Visual Shader Editing Tool
+// Copyright (c) Amplify Creations, Lda <info@amplify.pt>
+
+using UnityEngine;
+using UnityEditor;
+using System;
+
+public class SingleLineTexture : MaterialPropertyDrawer
+{
+ public override void OnGUI( Rect position, MaterialProperty prop, String label, MaterialEditor editor )
+ {
+ EditorGUI.BeginChangeCheck();
+ EditorGUI.showMixedValue = prop.hasMixedValue;
+
+ Texture value = editor.TexturePropertyMiniThumbnail( position, prop, label, string.Empty );
+
+ EditorGUI.showMixedValue = false;
+ if( EditorGUI.EndChangeCheck() )
+ {
+ prop.textureValue = value;
+ }
+ }
+}