title: Unity - How to create a Custom Editor for dynamically change size of a list inside an other list with custom size?
body: <p>I want to create a Custom Editor for Unity with a list inside a list and allow to edit the size dynamically and with a Popup inside the second list.</p>
  
  <p>Here is a couple of examples of what I want:</p>
  
  <p><img src="https://i.stack.imgur.com/s6DpM.png" alt="Example 1"></p>
  
  <p><img src="https://i.stack.imgur.com/Hb99m.png" alt="Example 2"></p>
  
  <p>The problem is that I can't change the second list size because it change the size of all the elements in the second list, so i can't have diferent sizes for each element of list.</p>
  
  <p>Also I have the same problem with the popup, the item selected is allways the same for all the popups (as you can see in the second image).</p>
  
  <p>How I can save each dimension or popup selected of each item selected without changing the others?</p>
  
  <p>Here is my code:</p>
  
  <blockquote>
    <p>ScriptableObject class</p>
  </blockquote>
  
  <pre><code>public class MyClass : ScriptableObject {
  
  public class MyInsideClass
  {
      public List&lt;string&gt; data;
  
      public MyInsideClass()
      {
          data = new List&lt;string&gt;();
      }
  }
  
  public List&lt;MyInsideClass&gt; allData;
  }
  </code></pre>
  
  <blockquote>
    <p>Custom Editor (Database just have the popup list names)</p>
  </blockquote>
  
  <pre><code>[CustomEditor(typeof(MyClass))]
  public class TempEdior : Editor
  {
      int numberOfCombinations = 0;
      int numberOfDataForCombination = 0;
      int selected = 0;
  
      public override void OnInspectorGUI()
      {
          GUILayout.BeginHorizontal();
          GUILayout.Label("Number of combinations:");
          numberOfCombinations =         EditorGUILayout.IntField(numberOfCombinations);
          GUILayout.EndHorizontal();
  
          for (int i = 0; i &lt; numberOfCombinations; i++)
          {
              GUILayout.BeginHorizontal();
              GUILayout.Label("Combination " + (i + 1) + " - number of data:");
              numberOfDataForCombination =     EditorGUILayout.IntField(numberOfDataForCombination);
              GUILayout.EndHorizontal();
  
              for (int j = 0; j &lt; numberOfDataForCombination; j++)
              {
                  Rect rect = EditorGUILayout.GetControlRect();
                  selected = EditorGUI.Popup(new Rect(rect.x + 63, rect.y, 100, EditorGUIUtility.singleLineHeight), selected,     Database.Instance.slotTypes.ToArray());
              }
          }
      }
  }
  </code></pre>