Using attributes to store data at edit time

Say I have an attribute that I add to a field. I want this attribute to store a Vector2 which is the position of this field in my custom editor. It works okay while in edit time, but seems to deserialise on Unity close/play. Is there a way to have attributes save their data, that is not declared in a constructor?
Thank you!

None by default, but the monoBehaviour or ScriptableObject that holds the attribute can.

(...)
public class FieldMarker : Attribute
{
    public string positionProperty;
    public FieldInputType displayType;

    (...)
    public FieldMarker(FieldInputType _diplayType, string _positionProperty)
    {
        //assign values.
    }
}
(...)

Then in your MonoBehaviour or ScriptableObject:

(...)
public class Test : MonoBehaviour
{
    [SerializeField] private Vector2 position;
    [SerializeField, FieldMarker(FieldInputType.Value, "position")] private float myVar;
}

Other option would be to create your own custom way to save and load data between Edit, Close and Play, but it really depends on what you are trying to do.