Why isn't my custom editor saving values?

It’s always reset to the default values as soon as I start the game.

[CustomEditor(typeof(MyClass))]
public class MyClassEditor : Editor
{
    MyClass subject;
    private void OnEnable()
    {
        subject = target as MyClass;
    }

    public override void OnInspectorGUI()
    {
        serializedObject.Update();

        //some interactions with variables in this.subject

        EditorUtility.SetDirty(target);
        serializedObject.ApplyModifiedProperties();
    }
}

You need to create a serialized object to update and apply, also how are you setting the values? I would also suggest using begin and end change check rather than applymodifiedproperies every call.

For example;

public class MyClass : MonoBehaviour
{
    public int MyInt;
}
using UnityEditor;

[CustomEditor(typeof(MyClass))]
public class MyClassEditor : Editor
{
    private SerializedObject _myClass;

    private void OnEnable()
    {
        _myClass = new SerializedObject(target);
    }

    public override void OnInspectorGUI()
    {
        _myClass.Update();

        EditorGUI.BeginChangeCheck();

        var myInt = _myClass.FindProperty("MyInt");

        EditorGUILayout.PropertyField(myInt);

        if (EditorGUI.EndChangeCheck())
        {
            //This is where undo is created and values are saved
            _myClass.ApplyModifiedProperties();
        }
    }
}

I was doing like this but then I cought many errors with arrays
Properties-arrays are null

[Serializable]
public class ChildClass1 : ParentClass
{
    public string str;
    public override void SomeMethod()
    {
        Debug.Log("some interactions");
    }
}
[Serializable]
public class ChildClass2 : ParentClass
{
    public int integer;

    public override void SomeMethod()
    {
        Debug.Log("some another interactions");
    }
}
[Serializable]
public abstract class ParentClass
{
    protected GameObject gameObject;

    public abstract void SomeMethod();
}
public class MyClass : MonoBehaviour
{
    public ParentClass[] array = new ParentClass[10];
}
[CustomEditor(typeof(MyClass))]
public class MyClassEditor : Editor
{
    private SerializedObject _object;
    private void OnEnable()
    {
        _object = new SerializedObject(target);
    }

    public override void OnInspectorGUI()
    {
        serializedObject.Update();
        var a = _object.FindProperty("array");
        Debug.Log(a.isArray); // NullReferenceException: Object reference not set to an instance of an object
        EditorUtility.SetDirty(target);
        serializedObject.ApplyModifiedProperties();
}

ParentClass is an abstract class. Make it a standard class with virtual methods. Unity can serialize that.

Thanks, it have worked for me.
But how i can insert to array something different from ParentClass?
_object.FindProperty("array").InsertArrayElementAtIndex(0)
InsertArrayElementAtIndex() will add a instance of ParentClass, not a instance of ChildClass1 or ChildClass2