EditorGUIlayout.popup issue

I am having trouble with the Popup function in my custom editor,

NewSectionList_[0] = EditorGUILayout.Popup("Section:", SectionList*[0], SectionOptions);*_

When i change the Popup option both NewSectionList[0] and SectionList_[0] take the new int value, how do i set it up so only the NewSectionList*[0] gets the value.*_

Are you sure that your “NewSectionList” is actually a seperate list / array and that you did not just copy the reference around? Since it seems to be a jagged array / list if you want to duplicate the list you have to duplicate all of the internal arrays / lists as well. Since we don’t know how you create your NewSectionList we can’t really say more about your issue. If you need more help with your code you have to include the part where you create your NewSectionList. Just keep in mind that Lists and arrays are reference types. Assigning one list / array to another variable does not duplicate the list / array.

@Bunny83 Thanks for the quick response, this is my code,

public string[] SectionOptions = new string[] { "Wall Section", "Window Section", "Door Section" };
    public List<int[]> SectionList = new List<int[]>();
    public List<int[]> NewSectionList = new List<int[]>();
    public List<WallSetupProperties> WallSetup = new List<WallSetupProperties>();
    public List<WindowSetupProperties> WindowSetup = new List<WindowSetupProperties>();
    public List<DoorSetupProperties> DoorSetup = new List<DoorSetupProperties>();
    public MaterialPool MaterialList = new MaterialPool();
    int[] ListValue = { 0, 0 };
    int[] NewListValue = { 0, 0 };

    public override void OnInspectorGUI()
    {
        EditorGUILayout.BeginVertical("box");
        if(NewSectionList.Count == 0)
        {
            NewSectionList.Add(ListValue);
        }

        WallSetupProperties wallDummy = new WallSetupProperties();
        WindowSetupProperties windowDummy = new WindowSetupProperties();
        DoorSetupProperties doorDummy = new DoorSetupProperties();
        int wall = 0;
        int window = 0;
        int door = 0;

        if (GUILayout.Button("Add Section"))
        {
            SectionList.Add(ListValue);
            NewSectionList.Add(NewListValue);
        }

        for(int i = 0;i < SectionList.Count; i++)
        {
            EditorGUILayout.BeginVertical("box");
            EditorGUILayout.BeginHorizontal("box");
      
            NewSectionList_[0] = EditorGUILayout.Popup("Section" + (i + 1).ToString("00") + ":", SectionList*[0], SectionOptions);*_

Found my problem, had to change

List<int[]>

to

List<int>

now everything is working for me.