Commit 2e1acb9
authored
added serde(default) to Transform (#23474)
# Objective
Need serde(Default) for Transform. I think it would be very useful in
cases where someone wants to add an object to their scene but doesn't
want to have to specify rotation or scale, e.g.:
```
5: (
components: {
"common::types::GameObjectKind": Rifle,
"bevy_transform::components::transform::Transform": (
translation: (1.5, 800.0, 0.0),
),
},
),
```
## Solution
Added `#[cfg_attr(feature = "serialize", serde(default))]` before the
Transform struct.
## Testing
Successfully built bevy, but haven't tested extensively. Theoretically
shouldn't break existing functionality, since Deriving Transform was
invalid before this PR.1 parent 09ef09e commit 2e1acb9
2 files changed
Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
| 32 | + | |
32 | 33 | | |
33 | 34 | | |
34 | 35 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
68 | 68 | | |
69 | 69 | | |
70 | 70 | | |
| 71 | + | |
71 | 72 | | |
72 | 73 | | |
73 | 74 | | |
| |||
0 commit comments