EditorWindow properties in Game Code

Brief description

Is it possible to expose EditorWindow properties (automatically serialized by Unity) so that they can be accessed in Game Code when compiled? Thanks


Full description

I have created a custom editor for a list of items…

7830-itemsview.png

public class ItemsEditor : EditorWindow
{
	public List<ItemDescriptor> Items = new List<ItemDescriptor>();
    // Other code...
}

I would like to copy this list in a publicly accessible static variable when running the game or compiling, but I couldn’t find any way to do so…

Can you help me?

Thanks, Fabio Iotti

You can’t access anything that’s stored in an Editor window. It’s for the Editor, not the build. Instead, store the data in Scriptable Objects in your project, and read from those objects, to the window. (Or, if you prefer, just use a custom Inspector for the Scriptable Object.) MonoBeaviours can reference Scriptable Objects.