Edit variables in another script through an Editor Window

I am trying to edit a variable in a script (let’s call it ExampleScript) through an Editor Window I created.

Thanks to my earlier question about custom editors and such, I had the opportunity to learn about serializedProperty and serializedObjects. Unfortunately, the Unity Script reference page is not very useful in this sense.

I have applied my own knowledge to the code but I am not able to get it to work. Mainly because I don’t know how I should combine the serialized property with the GUI.TextField or TextArea?

Any advices? I would take as an answer even a tutorial from anywhere cause I didn’t find any.

You can edit fields using the EditorGUILayour.PropertyField() method which takes in a PropertyField instance, like the following.

SerializedProperty name = serializedObject.FindProperty("Name");
EditorGUILayout.PropertyField(name);

A great tutorial for creating Custom Editor scripts can be found here it explains how to use SerializedProperty as well as SerializedObject.

Moved as answer as no other answer was received:

Would it be possible for me to access variables from a script outside of the Editor folder without using serialized properties and objects?