Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- [CustomEditor(typeof(TonScript))]
- public class TonScriptEditor : Editor
- {
- public override void OnInspectorGUI()
- {
- DrawDefaultInspector();
- TonScript script = (TonScript)target;
- if (script.mySprite != null)
- {
- Texture2D texture = script.mySprite.texture;
- Rect rect = GUILayoutUtility.GetRect(100, 100, GUILayout.ExpandWidth(false));
- EditorGUI.DrawPreviewTexture(rect, texture);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment