blob: b2d6754e5bdea0752e912555be17e22787453599 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
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;
}
}
}
|