Custom inspector resets values when refreshing

I have this code

using UnityEngine;
using UnityEditor;

[CustomEditor( typeof(Preview) )]
public class PreviewEditor : Editor
 float PreviewAngleAlpha = 0.25f;

	public override void OnInspectorGUI() {

		PreviewAngleAlpha = EditorGUILayout.Slider("PreviewAngle Alpha: ", PreviewAngleAlpha, 0.0f, 1.0f, GUILayout.Width(350));


so I have a value PreviewAngleAlpha that varies between 0 and 1 that I can adjust with a slider in the inspector, but everytime when I click on an a different object and then click back on the first object with this custom inspector on it, the value resets to 0.25f… How can I make it so that the inspector keeps using the same values?

Another option is to make the float variable static

static float PreviewAngleAlpha = 0.25f;

This will make it such that all PreviewEditor’s will use the SAME float value: change it in one, you change it in all.

*This will NOT save the value across sessions; see Sergio7888’s answer for that.