Scripting API
Scripting API
SerializeAllFieldsAttribute
Class in Abyss.Core, from Abyss.Core.
Says that a scene writes every field of this component, even one that holds what a load would give it anyway.
public sealed class SerializeAllFieldsAttribute : AttributeRemarks
What it changes. A scene leaves out a field that holds what a load starts it as: a file then says what somebody chose and nothing else. The cost is that such a field follows the default: change what a new one starts as in a later build and every scene that left it out changes with it. A field written down keeps its value.
So a component whose values must not move when its author changes their mind — balance data, a level's tuning — says so here, and every field of it is written wherever it is saved, and so is the component itself where another component would bring it back. A whole project says the same of every component with <AbyssForceSerializeAllFields> in its project file; see SceneWriting.ForceSerializeAllFields. A Rust component says it with #[reflect(SerializeAllFields)].
What a file cannot hold is still left out: what Bevy works out for itself, and what the engine cannot describe. And an instance of a prefab still writes only what differs from the prefab.
[AbyssComponent][SerializeAllFields]public partial struct Balance{ public float Damage; public float Cooldown;}