Commit d0f73d4
fix: Add OnPreShutdown to NetworkManager (#3358)
This PR adds a `NetworkManager.OnPreShutdown` callback that happens
before the internal shutdown is done. This is to allow accessing any
state that is cleaned up by the `NetworkManager` during shutdown, such
as accessing dynamically spawned NetworkObjects.
fix: #3145
close: #3145
## Changelog
- Added: The event NetworkManager.OnPreShutdown has been added which is
called before the NetworkManager cleans up and shuts down.
## Testing and Documentation
- A test has been added to ensure this is being called, and called
before OnServerStopped.
<!-- Uncomment and mark items off with a * if this PR deprecates any
API:
### Deprecated API
- [ ] An `[Obsolete]` attribute was added along with a `(RemovedAfter
yyyy-mm-dd)` entry.
- [ ] An [api updater] was added.
- [ ] Deprecation of the API is explained in the CHANGELOG.
- [ ] The users can understand why this API was removed and what they
should use instead.
-->
---------
Co-authored-by: Noel Stephens <[email protected]>1 parent ced4384 commit d0f73d4
File tree
3 files changed
+49
-0
lines changed- com.unity.netcode.gameobjects
- Runtime/Core
- Tests/Runtime
3 files changed
+49
-0
lines changedLines changed: 8 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
477 | 477 | | |
478 | 478 | | |
479 | 479 | | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
480 | 486 | | |
481 | 487 | | |
482 | 488 | | |
| |||
1198 | 1204 | | |
1199 | 1205 | | |
1200 | 1206 | | |
| 1207 | + | |
| 1208 | + | |
1201 | 1209 | | |
1202 | 1210 | | |
1203 | 1211 | | |
| |||
Lines changed: 40 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
237 | 237 | | |
238 | 238 | | |
239 | 239 | | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
240 | 280 | | |
241 | 281 | | |
242 | 282 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
928 | 928 | | |
929 | 929 | | |
930 | 930 | | |
| 931 | + | |
931 | 932 | | |
932 | 933 | | |
933 | 934 | | |
| |||
0 commit comments