refactor: use scriptable object for spawnable prefabs #1127
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This breaking change changes ClientObjectManager to use a scriptable object instead of a simple list for its spawnable prefabs.
You create the network prefabs object from the ClientObjectManager. A button prompting you to create one appears if the field is null.
I've added a quality-of-life feature that takes your old prefabs, if you're upgrading from an old version, and includes them in the network prefabs scriptable object when you create it through the inspector.
I've also moved the Register All Prefabs button to the network prefabs object from the ClientObjectManager.
The network prefabs object also has an editor, both for IMGUI and one for UI Toolkit to fit in properly with Unity 2022.2.
All the new code should be covered by tests.
This change would also benefit #1122 so it could be added too.