Commit 3fd2bf5
* fix
WIP fix for prefab overrides
* update
Removing restriction on PrefabIdHash.
No longer using OverrideToNetworkPrefab.
* update
Removing remains of OverrideToNetworkPrefab
* fix: validation
Putting back the NetworkPrefabs.OverrideToNetworkPrefab to avoid validation issues.
* Update NetworkObject.cs
Removing commented out code.
* update
Adding a new method: NetworkSpawnManager.InstantiateAndSpawn that handles several steps for users. Basically passing in a prefab NetworkObject will instantiate, spawn, and then return the spawned prefab instance. This takes into account prefab overrides.
Added a manual test "SimpleSpawn" to manually validate the updates.
* style
spelling in xml API
minor rewording
* style
expanded upon the GetNetworkObjectToSpawn description
* style
fixing namespace ordinal ordering
* update
Added some additional improvements to the simple spawn sample/manual test that also provides an example of the legacy/alternate way to spawn prefabs along with unique prefabs that are named appropriately for each scenario while also setting the color of the NetworkObjectId label to the assigned owner/client assigned color.
* test and update
This update includes automatic linking of in-scene placed NetworkObjects to their source prefab asset. This is specifically useful for when scene management is disabled as it removes the requirement to create a prefab override per in-scene placed NetworkObject. This also assures that a prefab with an override can still be used as an in-scene placed NetworkObject without the client spawning the overide when scene management is disabled while also still spawing the override of the same prefab when dynamically spawned.
This also includes an integration test to validate both with and without scene management enabled that clients synchronize to the proper prefab instance.
* test update and fix
Reverting the NetworkPrefabs change and just using the SourcePrefabToOverride.
Renamed InScenePlacedSourceGlobalObjectId to InScenePlacedSourceGlobalObjectIdHash to avoid confusion.
Updated the PrefabExtendedTests and test assets to include the scenario that is not handled when scnee management is disabled (i.e. in-scene defined NetworkObjects).
* style
null check standard adjustment
* update
Adding logic to only spawn override (as a default) when running as a host.
* update
Repopulating the override dictionary to avoid breaking any user's project that utilizes it.
Added NetworkObject.InstantiateAndSpawn method.
* update
Adding change log entries.
* update
Updating how errors and warning messages are handled.
* test
Validating that all error messages occur when expected.
* style
removing CR and adding an s to the end of TestsInstantiateAndSpawnErrors
* fix
Putting the OverrideToNetworkPrefab check in the right location.
* update
Adding back the OverrideToNetworkPrefab to continue to support the legacy manual instantiate and spawn usage pattern.
Updated comments to reflect this and to point users to use InstantiateAndSpawn methods.
* update
Adding a static version of InstantiateAndSpawn to NetworkObject.
* Test
Adding a test pass for validating that the legacy instantiate and spawn usage pattern still works.
---------
Co-authored-by: Unity Netcode CI <74025435+netcode-ci-service@users.noreply.github.com>
1 parent 94a2ffc commit 3fd2bf5
File tree
58 files changed
+7371
-132
lines changed- com.unity.netcode.gameobjects
- Runtime
- Configuration
- Core
- SceneManagement
- Spawning
- TestHelpers/Runtime
- testproject
- Assets
- Materials
- Prefabs
- Samples
- SpawnObject
- Tests
- Manual
- PrefabTestAssets
- Scripts
- Runtime
- ProjectSettings
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
58 files changed
+7371
-132
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| 21 | + | |
21 | 22 | | |
22 | 23 | | |
23 | 24 | | |
| |||
33 | 34 | | |
34 | 35 | | |
35 | 36 | | |
| 37 | + | |
36 | 38 | | |
37 | 39 | | |
38 | 40 | | |
| |||
41 | 43 | | |
42 | 44 | | |
43 | 45 | | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
44 | 51 | | |
45 | 52 | | |
46 | 53 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
132 | 132 | | |
133 | 133 | | |
134 | 134 | | |
135 | | - | |
| 135 | + | |
136 | 136 | | |
137 | 137 | | |
138 | 138 | | |
| |||
Lines changed: 13 additions & 18 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
33 | 39 | | |
34 | 40 | | |
35 | 41 | | |
| |||
234 | 240 | | |
235 | 241 | | |
236 | 242 | | |
237 | | - | |
| 243 | + | |
| 244 | + | |
238 | 245 | | |
239 | 246 | | |
240 | 247 | | |
| |||
262 | 269 | | |
263 | 270 | | |
264 | 271 | | |
265 | | - | |
| 272 | + | |
266 | 273 | | |
267 | 274 | | |
268 | 275 | | |
| |||
296 | 303 | | |
297 | 304 | | |
298 | 305 | | |
299 | | - | |
300 | | - | |
301 | | - | |
302 | | - | |
303 | | - | |
304 | | - | |
305 | | - | |
306 | | - | |
307 | | - | |
308 | | - | |
309 | 306 | | |
310 | 307 | | |
311 | 308 | | |
312 | | - | |
313 | | - | |
314 | | - | |
315 | | - | |
316 | | - | |
317 | 309 | | |
318 | 310 | | |
319 | 311 | | |
320 | | - | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
321 | 316 | | |
322 | 317 | | |
323 | 318 | | |
| |||
0 commit comments