@@ -18,6 +18,8 @@ internal static void Open()
1818
1919 private SerializedObject target ;
2020
21+ private Vector2 scrollViewPos ;
22+
2123 private void OnGUI ( )
2224 {
2325 if ( target == null )
@@ -26,10 +28,12 @@ private void OnGUI()
2628 target = new SerializedObject ( Settigns ) ;
2729 }
2830
31+ GUILayout . BeginScrollView ( scrollViewPos ) ;
32+
2933 SerializedProperty authorsProp = target . FindProperty ( "_authorsSerialization" ) ;
3034 SerializedProperty typesProp = target . FindProperty ( "_typesSerialization" ) ;
3135 int oldAuthorsCount = authorsProp . arraySize ;
32- int typesCount = typesProp . arraySize ;
36+ int oldTypesCount = typesProp . arraySize ;
3337 GUI . enabled = true ;
3438
3539 EditorGUI . BeginChangeCheck ( ) ;
@@ -42,15 +46,17 @@ private void OnGUI()
4246 for ( int i = oldAuthorsCount ; i < authorsProp . arraySize ; i ++ )
4347 authorsProp . GetArrayElementAtIndex ( i ) . FindPropertyRelative ( "_id" ) . intValue = 0 ;
4448 }
45- if ( typesProp . arraySize != typesCount )
49+ if ( typesProp . arraySize != oldTypesCount )
4650 {
47- for ( int i = oldAuthorsCount ; i < typesProp . arraySize ; i ++ )
51+ for ( int i = oldTypesCount ; i < typesProp . arraySize ; i ++ )
4852 typesProp . GetArrayElementAtIndex ( i ) . FindPropertyRelative ( "_id" ) . intValue = 0 ;
4953 }
5054 target . ApplyModifiedProperties ( ) ;
5155 EditorUtility . SetDirty ( Settigns ) ;
5256 Settigns . Save ( ) ;
5357 }
58+
59+ GUILayout . EndScrollView ( ) ;
5460 }
5561 }
5662}
0 commit comments