Assignment for RMIT Mixed Reality in 2020
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

23 lines
623 B

// 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;
}
}
}