File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ public class TexturePackerWindow : EditorWindow
1010 {
1111 private readonly string _windowTitle = "Channel Packer" ;
1212 private readonly Vector2 _windowSize = new Vector2 ( 300 , 450 ) ;
13-
13+ private readonly int _maxInputCount = 4 ;
1414 private readonly int _textureSupportedResolutionMin = 64 ;
1515 private readonly int _textureSupportedResolutionMax = 8192 ;
1616
@@ -73,16 +73,24 @@ private void OnGUI()
7373
7474 GUILayout . Label ( "Inputs" , TexturePackerStyles . Heading ) ;
7575 foreach ( TextureItem item in _items )
76+ {
7677 item . Draw ( ) ;
78+ }
7779
7880 EditorGUILayout . BeginHorizontal ( ) ;
7981 GUILayout . FlexibleSpace ( ) ;
82+
83+ GUI . enabled = _items . Count < _maxInputCount ;
84+
8085 if ( GUILayout . Button ( "+" ) )
8186 {
8287 TextureInput entry = new TextureInput ( ) ;
8388 _texturePacker . Add ( entry ) ;
8489 _items . Add ( new TextureItem ( entry ) ) ;
8590 }
91+
92+ GUI . enabled = true ;
93+
8694 GUILayout . FlexibleSpace ( ) ;
8795 EditorGUILayout . EndHorizontal ( ) ;
8896
You can’t perform that action at this time.
0 commit comments