Custom Editor loosing data on play

Hi!
I’m trying to make a custom editor, but when I hit play, all the data gets losts, and when y stop the game, the values resets to it’s defaults values.

My variables:

public GameObject [] prefabs; public int [] maxSamples; public Vector3 bufferZone;

My editor code:

using UnityEngine;

using System.Collections;

using UnityEditor;

using System.Collections.Generic;

[CustomEditor(typeof(BetterInstantiate))]

public class BetterInstantiateEditor : Editor
{

private List<GameObject> prefabs;
private List<int> maxSamples;

public override void OnInspectorGUI()
{
    BetterInstantiate betterInstantiateScript = (BetterInstantiate)target;
    betterInstantiateScript.bufferZone = EditorGUILayout.Vector3Field ("Buffer Zone:", betterInstantiateScript.bufferZone);
    if (this.prefabs == null) //Aún no hemos creado los ArrayList
    {
        this.prefabs = new List<GameObject>();
        this.maxSamples = new List<int>();
    }
    int numberOfPrefabs = this.prefabs.Count;
    EditorGUILayout.LabelField("Number of Prefabs:", numberOfPrefabs.ToString());
    if (GUILayout.Button ("Add Prefab"))
    {
    	numberOfPrefabs ++;
    	this.prefabs.Add ((GameObject)null);
    	this.maxSamples.Add(0);
    }
    if (GUILayout.Button ("Remove Prefab") && numberOfPrefabs != 0)
    {
		numberOfPrefabs --;        	
            this.prefabs.RemoveAt(this.prefabs.Count - 1);
            this.maxSamples.RemoveAt(this.maxSamples.Count - 1);
    }
    for (int i = 0; i < numberOfPrefabs; i++)
    {
    	this.prefabs  _= ((GameObject)EditorGUILayout.ObjectField ("Prefab:", (GameObject)this.prefabs *, typeof(GameObject), false));*_

this.maxSamples = (EditorGUILayout.IntField(“Max Sim. Objects:”, (int)this.maxSamples ));
}
//Comprobamos que no haya dos prefabs con el mismo nombre
ArrayList names = new ArrayList();
for (int i = 0; i < numberOfPrefabs; i++)
{
_ if (this.prefabs == null)
* continue;
for (int j = 0; j < names.Count; j++)
{
if (string.Compare(((GameObject)this.prefabs ).ToString(), (string)names [j]) == 0)
Debug.LogError(“You can’t put 2 prefabs with the same name!”);
}
names.Add(((GameObject)this.prefabs ).ToString());
}
betterInstantiateScript.prefabs = this.prefabs.ToArray();
betterInstantiateScript.maxSamples = this.maxSamples.ToArray();
}
}*

I tried using Serializable and System.Serialize but it didn’t work. The editor don’t save nothing, the Vector3 is lost too, while in other custom editors I made this didn’t happened.
Thank you._

@miguellahoz: Hi there! You need to mark the fields you want to persist with the SerializeField attribute.