[ExecuteInEditMode]problem

Okey so i have written a custom editor for my script. I push a button and it generates a lot of stuff in my scene when in editMode.

But here’s my problem:

When i execute my script in editMode it creates some lists, and if i debug while the script is running everything is running well.

But when i launch my game suddenly all lists are “null”. I have tried changing where i instantiate the Lists but either i get null, or they get instantiated with 0.

But when i run the script in edit mode it creates and adds to the lists in a correct way. I also store som variables they get stored, but my lists don’t. Is this normal behaviour? that Unity doesn’t store lists in editmode but stores variables?

Any thoughts? any solutions?

Any variable you want to be treated as persistent needs to be serialized with [SerializeField] (public automatically gets treated as a serialized field).