Editor window getting info from another script issue

Hey UA !

I’m using a window editor script to save some informations of an object in the scene in a XML file.

My window editor script has the object script :

_object = (ObjectScript)EditorGUILayout.ObjectField("OBJECT", _object , typeof(ObjectScript), true);

That ObjectScript has some values like :

public Vector2 VORTEX_POSITION;
public Vector2 BLOC_WIDTH_RANGE;
//...

I’m trying to catch these values at runtime but the ObjectScript return only the values set before I hit play not the one actually displayed in the editor (that I modified after hitting play) …

I tried things with [System.Serializable] and EditorUtility.SetDirty (_object) but I don’t think I understood it properly.

Any pointers ? :slight_smile:
Thanks !

1 Answer

1

I was wondering if it wasn’t a problem of declared property in the window editor before and after hitting play.

So I wrote some lines to update at each frame the handle on the _object and it works now …

So quick answer is to refresh the handle of the script given to the window editor script after hitting play.