2025-07-08 14:28:40 -04:00
|
|
|
// Amplify Shader Editor - Visual Shader Editing Tool
|
|
|
|
|
// Copyright (c) Amplify Creations, Lda <info@amplify.pt>
|
|
|
|
|
|
|
|
|
|
using UnityEngine;
|
|
|
|
|
using UnityEditor;
|
|
|
|
|
using System;
|
|
|
|
|
|
2026-03-14 03:13:10 -04:00
|
|
|
namespace AmplifyShaderEditor
|
2025-07-08 14:28:40 -04:00
|
|
|
{
|
2026-03-14 03:13:10 -04:00
|
|
|
public class SingleLineTexture : MaterialPropertyDrawer
|
2025-07-08 14:28:40 -04:00
|
|
|
{
|
2026-03-14 03:13:10 -04:00
|
|
|
public override void OnGUI( Rect position, MaterialProperty prop, String label, MaterialEditor editor )
|
|
|
|
|
{
|
|
|
|
|
EditorGUI.BeginChangeCheck();
|
|
|
|
|
EditorGUI.showMixedValue = prop.hasMixedValue;
|
2025-07-08 14:28:40 -04:00
|
|
|
|
2026-03-14 03:13:10 -04:00
|
|
|
Texture value = editor.TexturePropertyMiniThumbnail( position, prop, label, string.Empty );
|
2025-07-08 14:28:40 -04:00
|
|
|
|
2026-03-14 03:13:10 -04:00
|
|
|
EditorGUI.showMixedValue = false;
|
|
|
|
|
if( EditorGUI.EndChangeCheck() )
|
|
|
|
|
{
|
|
|
|
|
prop.textureValue = value;
|
|
|
|
|
}
|
2025-07-08 14:28:40 -04:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|