serialize a list

sorry this question got pretty messy from constant edits so cleaning up. In the following example I am filling the boardKeyData and boardValueData during edit mode with the tileMapInspector custom editor class. This works fine, however, as soon as i hit play the lists get cleared so that they don’t contain anything. What am i doing wrong here? Thanks in advance.

Here are the classes involved:

[System.Serializable]
public class createBoard : MonoBehaviour {

	public MapGenerator mapGenerator;

	public int definedMapSize;
	
	public List<Vector2> boardKeyData;
	public List<Tile> boardValueData;

	// Use this for initialization
	void Start () {
		initializeBoard();
	}

	void initializeBoard(){
		if(boardKeyData.Count == 0){
			Debug.Log ("wtf");
		}

		Debug.Log ("initialising board");

		for(int i = 0; i < boardKeyData.Count; i++){
			GridManager.instance.board.Add(boardKeyData_,boardValueData*);*_

* }*
* }*

* // Update is called once per frame*
* void Update () {*

* }*
}
[CustomEditor(typeof(createBoard))]
public class tileMapInspector : Editor {

* createBoard CB;*

* public override void OnInspectorGUI(){*
* base.DrawDefaultInspector();*

* if(GUILayout.Button(“Regenerate”)){*
* CB = (createBoard)target;*

* CB.mapGenerator.size_x = CB.definedMapSize;
CB.mapGenerator.size_z = CB.definedMapSize;
_
CB.mapGenerator.tileSize = CB.mapGenerator.gridManager.tileSize;*_

* CB.mapGenerator.gridManager.board = CB.mapGenerator.spawnMeshes(CB.mapGenerator.meshParent.transform,true, true , true, false);*
* storeBoardData(CB.mapGenerator.gridManager.board);*

* CB.mapGenerator.gridManager.getNeighbours(true);*
* CB.mapGenerator.gridManager.setSizes();*

* CB.mapGenerator.PG.board = CB.mapGenerator.meshParent;*
* }*
* }*

* void storeBoardData(Dictionary<Vector2, Tile> board){*
* Debug.Log (“being called”);*
* CB.boardKeyData = new List();*
* CB.boardValueData = new List();*

* foreach(Vector2 key in board.Keys){*
* CB.boardKeyData.Add (key);*
* }*

* foreach(Tile value in board.Values){*
* CB.boardValueData.Add (value);*
* }*

* }*
}

Try this

serializedObject.Update ();
DrawDefaultInspector();
serializedObject.ApplyModifiedProperties ();