Property values changed by custom editor are reset when start playing

I have a scripts like this below. Problem is when I assign value to clampedValue in inspector and click play button all private fields are reset to their default value. So if I assign 60 to clampedValue, in play mode it becomes 50 again. How can I save values of properties (of private fields)?

(Sorry for my English)

public class MyClass : MonoBehaviour
{
    public float clampedValue
    {
        get { return _clampedValue; }
        set { _clampedValue = Mathf.Clamp(value, 0, Mathf.Infinity); }
    }

    private float _clampedValue = 50f;
}

[CustomEditor(typeof(MyClass))]
public class MyClassEditor : Editor
{
    public override void OnInspectorGUI()
    {
        MyClass obj = (MyClass)target;
        obj.clampedValue = EditorGUILayout.FloatField("Clamped Value", obj.clampedValue);
    }
}

I had a similar problem.
It turned out I was editing a prefab and had to set EditorUtility.SetDirty(target); to indicate to the editor that the prefab instance has changed properties.

Maybe it’s because you’re handling a property and the actual field is not an inspector field?