Commit 429b256
fix: Objects without observers are DestroyWithOwner (#3342)
<!-- Replace this block with what this PR does and why. Describe what
you'd like reviewers to know, how you applied the engineering
principles, and any interesting tradeoffs made. Delete bullet points
below that don't apply, and update the changelog section as appropriate.
-->
- Ensure objects with no observers (or only current owner as observer)
are treated as if `DontDestroyWithOwner = true` on client disconnect
- Explicitly check if childObject has new client as observer on client
connect
<!-- Add short version of the JIRA ticket to the PR title (e.g. "feat:
new shiny feature [MTT-123]") -->
[MTTB-1041](https://jira.unity3d.com/browse/MTTB-1041)
Changelog for this is in #3323.
<!-- Add RFC link here if applicable. -->
## Changelog
- Fixed: Ensure objects with no observers are treated as if
`DontDestroyWithOwner = true` on client disconnect
## Testing and Documentation
- No tests have been added.
<!-- 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 <noel.stephens@unity3d.com>1 parent e0da299 commit 429b256
File tree
2 files changed
+12
-5
lines changed- com.unity.netcode.gameobjects/Runtime
- Connection
- Spawning
2 files changed
+12
-5
lines changedLines changed: 10 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1173 | 1173 | | |
1174 | 1174 | | |
1175 | 1175 | | |
1176 | | - | |
| 1176 | + | |
| 1177 | + | |
1177 | 1178 | | |
1178 | | - | |
| 1179 | + | |
1179 | 1180 | | |
1180 | 1181 | | |
1181 | 1182 | | |
1182 | 1183 | | |
1183 | 1184 | | |
1184 | 1185 | | |
1185 | | - | |
| 1186 | + | |
1186 | 1187 | | |
1187 | 1188 | | |
1188 | 1189 | | |
| |||
1240 | 1241 | | |
1241 | 1242 | | |
1242 | 1243 | | |
| 1244 | + | |
| 1245 | + | |
| 1246 | + | |
| 1247 | + | |
| 1248 | + | |
| 1249 | + | |
1243 | 1250 | | |
1244 | 1251 | | |
1245 | 1252 | | |
| |||
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1975 | 1975 | | |
1976 | 1976 | | |
1977 | 1977 | | |
1978 | | - | |
1979 | | - | |
| 1978 | + | |
| 1979 | + | |
1980 | 1980 | | |
1981 | 1981 | | |
1982 | 1982 | | |
| |||
0 commit comments