File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -5,6 +5,8 @@ namespace TexPacker
55{
66 public class TexturePreview
77 {
8+ private int toolbarItem = 0 ;
9+
810 public void Draw ( TexturePacker texPacker )
911 {
1012 GUILayout . Label ( "Preview" , TexturePackerStyles . Heading ) ;
@@ -22,11 +24,19 @@ public void Draw(TexturePacker texPacker)
2224 texPacker . ClearProperties ( ) ;
2325
2426 Texture2D preview = texPacker . Create ( ) ;
25- EditorGUI . DrawPreviewTexture ( alphaRect , preview ) ;
27+ preview . alphaIsTransparency = true ;
28+
29+ if ( toolbarItem == 0 )
30+ EditorGUI . DrawPreviewTexture ( alphaRect , preview ) ;
31+ else
32+ EditorGUI . DrawTextureAlpha ( alphaRect , preview ) ;
2633
2734 GUILayout . FlexibleSpace ( ) ;
2835 GUILayout . EndHorizontal ( ) ;
2936
37+ string [ ] toolbarItems = { "RBG" , "Alpha" } ;
38+ toolbarItem = GUILayout . Toolbar ( toolbarItem , toolbarItems ) ;
39+
3040 GUILayout . EndVertical ( ) ;
3141 }
3242 }
You can’t perform that action at this time.
0 commit comments