Checking for duplicate inventory items UUIDs?

Why do we check if the inventory item UUID is a duplicate in GetFromID() instead of before assigning it, as we do for SavableEntities?

I know that the chances of a duplicate are really low, but wouldn’t it be safer to do it the same way we did it in the core combat course?

ScriptableObjects don’t have the same hooks that Monobehaviors do (Update, to be precise) so another method had to be devised.

Sorry if I explained that poorly. I get that its not possible to use the same system to assign the UUID, that’s not my question. What I am asking is why there’s no safety check for duplicate UUID when we assign it unlike what we did for DSavableEntities, and we leave the check for later, when something else in the game tries to grab an object via ID.
Seems to me a more fragile system, you might not be aware that you have an issue with duplicate IDs, as unlikely as it might be (or very likely actually, all it takes is to duplicate an inventory item in the asset menu instead of creating it from scratch), until something in your game tries to work with that specific item.

Privacy & Terms