Skip to content

Instantly share code, notes, and snippets.

Last active July 5, 2018 14:15
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
Example for using GUILayoutUtility to draw a texture
using UnityEngine;
using UnityEditor;
public class EntityInspector : Editor {
public override void OnInspectorGUI()
MyMono mono = (MyMono)target;
EditorGUILayout.LabelField("Item Icon: ");
Rect rect = GUILayoutUtility.GetRect(100, 100);
EditorGUI.DrawTextureTransparent(rect, mono.texture, ScaleMode.ScaleToFit);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment