You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Mar 22, 2021. It is now read-only.
I just wanted to confim a theory or If my code is incorrect somewhere. I have notice that the level gird is reset and reinitiated when the level object loses focus. This means if I clicked in the console, then back to the level object and try to edit an existing painted prefab. There was previously a nullException but I have changed my code to handle a null cell. So am I correct that I need to save my grid in the OnDisable and on OnEnable reload my existing grid? If yes, and serialization is the correct apporach. How would I serialize my List object? I have add the [serialize] paramater heading to the levelPieces class. What I am unsure of is if I have to nest levelPieces to do serialization correctly?
What I mean is instead of serializing levelPieces. I would create a 2nd class that was serialized that only containes a list of levelPieces. (Would I mark the List propety object as a serialize field?). Then in the LevelInspector class create a List<2ndClass>() object that created instance of a levelPiece? Is this step needed?
Or did I miss something in the book and the level and all the data in the array is suppose to remain in memory when you click out of unity or deselect the Level object? If so which page and chapter is that so I can go back and check?
Thanks.
The text was updated successfully, but these errors were encountered:
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
I just wanted to confim a theory or If my code is incorrect somewhere. I have notice that the level gird is reset and reinitiated when the level object loses focus. This means if I clicked in the console, then back to the level object and try to edit an existing painted prefab. There was previously a nullException but I have changed my code to handle a null cell. So am I correct that I need to save my grid in the OnDisable and on OnEnable reload my existing grid? If yes, and serialization is the correct apporach. How would I serialize my List object? I have add the [serialize] paramater heading to the levelPieces class. What I am unsure of is if I have to nest levelPieces to do serialization correctly?
What I mean is instead of serializing levelPieces. I would create a 2nd class that was serialized that only containes a list of levelPieces. (Would I mark the List propety object as a serialize field?). Then in the LevelInspector class create a List<2ndClass>() object that created instance of a levelPiece? Is this step needed?
Or did I miss something in the book and the level and all the data in the array is suppose to remain in memory when you click out of unity or deselect the Level object? If so which page and chapter is that so I can go back and check?
Thanks.
The text was updated successfully, but these errors were encountered: