-
Notifications
You must be signed in to change notification settings - Fork 16
Open
Description
It would be nice to be able to mark a key/property/field such that it will be set if it exists in a file but will not be written when saving that type to a file.
Take this struct for example:
public struct Angle
{
[SaveThis]
public float degrees;
// [OnlyRead]
public float radians
{
set => degrees = value / 6.283184f * 360f;
get => degrees * 6.283184f / 360f;
}
}If you are loading a file and the entry has radians: 3.141592 it should set the radians property (and by extension the degrees field) properly. But when saving a file there is no need to have both written. So by tagging radians with [OnlyRead] it would be set when reading but not written when saving.
It would also be useful for updating an existing type and want to mark an old field as obsolete. You wouldn't want to save that data when saving but you may still want to read it for backwards compatibility reasons.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels