In this lecture Sam talks about the woes of not having Unity updating in edit mode and he shows examples of how the GUID is not being updated since it is set as a [SerializeField] and so we go through the process of making the SaveableEntity.cs attributed with [ExecuteAlways] and we edit the Update() to only run when the Application is not playing. Sure, but why? I really don’t understand it clearly. I I mean I understand the words said but I don’t feel like he explained why this was an issue in a clear way? Maybe it is brought up again further into the series but I have a hard time just leaving this and moving on until I understand why we are doing it this way.
I know this section is not for beginners but I have dealt with way more complex systems in c# prior to this and I am not unfamiliar with the code, I am very unfamiliar with this particular implementation though and if anyone had time to properly explain why we care about the scripts behavior in edit mode when the game never will be played in edit mode, please enlighten me.
Thank you
EDIT:
To clarify I can loosely describe what I am guessing the reason to be:
The way I (not really) understand it, we are going through all of this because we want to solve the issue of persistence between loads due to the fact that we are using [SerializeField] to achieve that.
And why we are using [SerializeField] to do that is because once we build the Application we want the GUID to have been set for all SaveableEntities and not be generated again at any point during the Applications lifetime.
The first enemy the player faces will have the same GUID for every player playing our game every time they restart and it will be the same as what we set it to now. But since the GUID won’t update correctly due to Unity not reliably updating the SerializeField in Edit mode we can’t 100% ensure that all the GUIDs will be correctly set by the time we decide to build the application unless we can update them while in Edit mode?