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

  1. // Amplify Shader Editor - Visual Shader Editing Tool
  2. // Copyright (c) Amplify Creations, Lda <info@amplify.pt>
  3. using UnityEngine;
  4. using UnityEditor;
  5. using System;
  6. public class SingleLineTexture : MaterialPropertyDrawer
  7. {
  8. public override void OnGUI( Rect position, MaterialProperty prop, String label, MaterialEditor editor )
  9. {
  10. EditorGUI.BeginChangeCheck();
  11. EditorGUI.showMixedValue = prop.hasMixedValue;
  12. Texture value = editor.TexturePropertyMiniThumbnail( position, prop, label, string.Empty );
  13. EditorGUI.showMixedValue = false;
  14. if( EditorGUI.EndChangeCheck() )
  15. {
  16. prop.textureValue = value;
  17. }
  18. }
  19. }