Q:

String fields not storing data

I have three string variables that I'm wanting to set in unity when my engine isn't running. However, when I enter my data into these fields, the moment I run my program, Unity wipes the strings. 
Can someone please tell me what I'm doing wrong?
I've tried everything i can think of and I'm getting no where:
In the editor class:
TestEdit target_Object;
public string event_NameString = "";
public string event_ActionString = "Event action";
public string event_Label = "Event label";

void OnEnable()
{
    target_Object = (TestEdit)target;
}

public override void OnInspectorGUI()
{

    GUILayout.BeginVertical();

    GUILayout.Space(10);
    enum_Index = EditorGUILayout.Popup(enum_Index, enum_Option);

    target_Object.nameString = event_NameString;

        event_NameString = EditorGUILayout.TextField("Event Category", event_NameString);
        event_ActionString = EditorGUILayout.TextField("Event Action", event_ActionString);
        event_Label = EditorGUILayout.TextField("Event Label", event_Label);

    GUILayout.Space(5);

    GUILayout.EndVertical();
}

Code in my script that I've attached to a game object:
string nameString = "";
string Test2 = "";
string Test3 = "";

void OnGUI()
{
    if(GUI.Button(new Rect(0,0,100,100), "Send stuff"))
        Analytics.gua.sendEventHit(nameString, Test2, Test3, 1);
}

Here is two images showing it as well:
Setting the string when Unity isn't playing:

Then when it is playing:

What I'm wanting to do is take these values in the editor and pass them to another string held in a seperate class. As the above strings are held in an editor class I have no way of directly accessing these values and if I'm honest, I'm a little fuzzy as to how unity passes these values back and forth. 

A:

Short answer: Unity doesn't serialize inspector values. If you need the data to be stored, it should probably be kept by the component being inspected.
You can think of Unity as a sort of behemoth object factory. After loading a scene and its resources, it can instantiate hundreds or thousands of GameObjects and components, then populate their serialized data, including in-scene and asset references. Each time your code changes and assemblies are recompiled, it repeats that process for many objects in the scene. Any data that's not serialized will be destroyed when that happens.
Every time you recompile, you're going to lose the inspector object.
Every time you load a scene, you're going to lose the inspector object.
I've never checked whether Unity drops inspector objects the moment their components are deselected, but I wouldn't be terribly surprised if it did.
Most important: editor scripts are never included in your final build, which might be an ugly surprise if anything in your client relies on them.
Going back to the short answer: I don't know what that string does, but any data you expect to be permanent shouldn't be kept by an inspector.

