Eonirr

Untitled

May 19th, 2025
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. [CustomEditor(typeof(TonScript))]
  2. public class TonScriptEditor : Editor
  3. {
  4. public override void OnInspectorGUI()
  5. {
  6. DrawDefaultInspector();
  7.  
  8. TonScript script = (TonScript)target;
  9.  
  10. if (script.mySprite != null)
  11. {
  12. Texture2D texture = script.mySprite.texture;
  13.  
  14. Rect rect = GUILayoutUtility.GetRect(100, 100, GUILayout.ExpandWidth(false));
  15. EditorGUI.DrawPreviewTexture(rect, texture);
  16. }
  17. }
  18. }
Advertisement
Add Comment
Please, Sign In to add comment