C # – How to Add a MonoBehavior Table from a Script Editor in Unity

I have created an editor that creates a list of tags and splits them into two lines of values ​​true or false (to be selected by the user). I then compiled this list into a dictionary, and each entry is as follows:

{"tag", bool, bool}

On my MonoBehavior script, I have two tables:

chain[] profondeur_tags;
chain[] angle_tags;

My goal is essentially to save the data from the dictionary and to be able to recall / assign them to the script. To do this, I tried adding arrays to these arrays based on the values ​​found in the script dictionary Editor.

I did a lot of research and it was the only potential solution I could find, but unfortunately, it did not work.

void update_tags ()
{

serializedObject.FindProperty ("depth_tags"). ClearArray ();
serializedObject.FindProperty ("angle_tags"). ClearArray ();

serializedObject.ApplyModifiedProperties ();

SerializedProperty depth_tags = serializedObject.FindProperty ("depth_tags");
SerializedProperty angle_tags = serializedObject.FindProperty ("angle_tags");

foreach (string tag in tag_list_values.Keys)
{

if (tag_list_values[tag][0]    == true)
{
//Debug.Log("DEPTH TAG: "+ tag);
depth_tags.InsertArrayElementAtIndex (0);
depth_tags.GetArrayElementAtIndex (0) .stringValue = tag;
}

if (tag_list_values[tag][1]    == true)
{
//Debug.Log("ANGLE TAG: "+ tag);
angle_tags.InsertArrayElementAtIndex (0);
angle_tags.GetArrayElementAtIndex (0) .stringValue = tag;
}

}

serializedObject.ApplyModifiedProperties ();

}

Any help would be greatly appreciated!