Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: use scriptable object for spawnable prefabs #1127

Closed

Conversation

Hertzole
Copy link
Contributor

@Hertzole Hertzole commented Jan 29, 2023

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.

James-Frowen pushed a commit that referenced this pull request Feb 1, 2023
squash of 3 commits:

- added network prefabs scriptable object
- add tests
- renamed Drawers to Inspector
James-Frowen pushed a commit that referenced this pull request Feb 2, 2023
squash of 3 commits:

- added network prefabs scriptable object
- add tests
- renamed Drawers to Inspector
@James-Frowen
Copy link
Member

merged as part of #1129

github-actions bot pushed a commit that referenced this pull request Feb 2, 2023
# [129.6.0](v129.5.0...v129.6.0) (2023-02-02)

### Bug Fixes

* fixing networkprefab drawer height ([8884070](8884070))

### Features

* adding buttons that create gameobject with NetworkIdentity ([0115818](0115818))
* adding custom drawer for networkprefab field ([bb34c04](bb34c04))
* drawing prefab list under NetworkPrefab reference ([8c63726](8c63726))
* hiding COM prefab list when it is empty and NetworkPrefab is set ([5088d33](5088d33))
* making RegisterPrefabs public ([77c8a48](77c8a48))
* use scriptable object for spawnable prefabs ([#1127](#1127)) ([1973e76](1973e76))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants