title: Unity creating arrays of my already made Editor/Property Drawer that has arrays in it
body: <p>I feel I am very close but for the life of me I cannot figure this out as I keep getting funky results.  In the image below I am wanting to make multiple of these but I just cant figure it out:</p>
  
  <p><a href="https://i.stack.imgur.com/PDifE.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/PDifE.png" alt="enter image description here"></a></p>
  
  <p>As you can see that I can see in the image above I would like there to be another "Size" which I can set a number and multiple of what you see in the red box would show up.</p>
  
  <p>At the moment I have a Camera_Positioning script with an Editor, a [System.Serializable] script that hold the variables and a Drawer that goes with it.</p>
  
  <p>I have tried making a script that would make an array of Camera_Positioning and I also attempted something along the lines of 2D arrays but I doesn't work or I am doing something wrong.  Anyone have any ideas on how to make an array of the red boxes I have?</p>
  
  <p>EDIT : Here is the code that I have currently :</p>
  
  <p>My Camera_Positioning and Camera_Positioning_Editor script.  The Camera_Positioning is what I attach to my GameObject.</p>
  
  <pre><code>public class Camera_Positioning : MonoBehaviour {
  
      public CamPosLookArray[] PosLook;
  
  }
  
  
  [CanEditMultipleObjects]
  [CustomEditor(typeof(Camera_Positioning))]
  public class Camera_Positioning_Editor : Editor {
  
  SerializedProperty posLook;
  
  
  void OnEnable()
  {
      // Setup the SerializedProperties.
      posLook = serializedObject.FindProperty("PosLook");
  }
  
  public override void OnInspectorGUI()
  {
      // Set the indentLevel to 0 as default (no indent).
      EditorGUI.indentLevel = 0;
      // Update
      serializedObject.Update();
  
      EditorGUILayout.PropertyField(posLook.FindPropertyRelative("Array.size"));
  
      EditorGUILayout.BeginHorizontal();
      EditorGUILayout.LabelField("Camera Position", EditorStyles.boldLabel, GUILayout.Width(Screen.width / 2.8f));
      EditorGUILayout.LabelField("Camera Look", EditorStyles.boldLabel, GUILayout.Width(Screen.width / 2.8f));
      EditorGUILayout.LabelField("Story", EditorStyles.boldLabel, GUILayout.Width(75f));
      EditorGUILayout.EndHorizontal();
  
      for (int i = 0; i &lt; posLook.arraySize; i++)
      {
          EditorGUILayout.PropertyField(posLook.GetArrayElementAtIndex(i), GUIContent.none);
      }
  
      // Apply.
      serializedObject.ApplyModifiedProperties();
  }
  }
  </code></pre>
  
  <p>My CamPosLookArray script:</p>
  
  <pre><code>[System.Serializable]
  public class CamPosLookArray  {
  
  public CameraPos_CameraLook[] PosLookArray;
  }
  </code></pre>
  
  <p>My CameraPos_CameraLook and CameraPos_CameraLook_Editor script:</p>
  
  <pre><code>[System.Serializable]
  public class CameraPos_CameraLook {
  
      public Transform CameraPosition;
      public Transform CameraLook;
      public int CameraStory;
  }
  
  
  [CustomPropertyDrawer(typeof(CameraPos_CameraLook))]
  public class CameraPos_CameraLook_Drawer : PropertyDrawer {
  
  // Draw the property inside the given rect
  public override void OnGUI(Rect position, SerializedProperty property, GUIContent label)
  {
      // Using BeginProperty / EndProperty on the parent property means that
      // prefab override logic works on the entire property.
      EditorGUI.BeginProperty(position, label, property);
  
      // Draw label
      position = EditorGUI.PrefixLabel(position, GUIUtility.GetControlID(FocusType.Passive), label);
  
      // Don't make child fields be indented
      var indent = EditorGUI.indentLevel;
      EditorGUI.indentLevel = 0;
  
      // Calculate rects
      Rect camPos = new Rect(position.x, position.y, Screen.width / 3f, position.height);
      Rect camLook = new Rect(position.x + Screen.width / 2.75f, position.y, Screen.width / 3f, position.height);
      Rect camStory = new Rect(position.x + (2.2f *Screen.width) / 3f, position.y, 75f, position.height);
  
      // Draw fields - passs GUIContent.none to each so they are drawn without labels
      EditorGUI.PropertyField(camPos, property.FindPropertyRelative("CameraPosition"), GUIContent.none);
      EditorGUI.PropertyField(camLook, property.FindPropertyRelative("CameraLook"), GUIContent.none);
      EditorGUI.PropertyField(camStory, property.FindPropertyRelative("CameraStory"), GUIContent.none);
  
      // Set indent back to what it was
      EditorGUI.indentLevel = indent;
  
      EditorGUI.EndProperty();
  }
  </code></pre>
  
  <p>}</p>
  
  <p>When I have all that I get :</p>
  
  <p><a href="https://i.stack.imgur.com/52b3v.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/52b3v.png" alt="enter image description here"></a></p>
  
  <p>What I am trying to achieve in the picture above is everywhere you see a triangle (2 of them) should be what is in the first picture at the top in the red box.</p>