Editor scripting: Save Scripts state (properties) in scene

I’m working on navmesh extension to free Unity version.
I’ve got NavMesh object which is parent of all navmesh vertices objects. This object has “NavMeshTriangles” script attached which stores two arrays: edges and triangles. (they hold vertices instances ids). Unfortunetly when i start the game and stop this arrays are empty (my nav mesh faces disappear), the same happens when i restart the editor.
Is there any simple way to save this scripts properties in scene?

Thanks for answers :slight_smile:

What container type are you using to hold the objects? Are you adding [System.Serializable] above these classes you’re defined?

Not quite understand first question, I’ve got a script which is being executed in edit mode and contains two arrays, first holds pairs of vertices instances ids (in int) for edges, second holds vertices instances ids for triangles (three ids per array element). My problem is when i exit Unity and start again, this arrays are empty. I hope there is some simple solution to save current scene state and restore it again later, something like for example “Undo.RegisterSceneUndo()” which retreve my scene correctly when i undo some navmesh operation, for example createTriangle.
I use Javascript.