How to get a value from SerializedProperty

Hi! I have a ScriptableObject that contains an Array of my custom classes and those custom classes have some values. How to reffer, get access to those values? I seem to find everything i could on custom editor topic and no-one go deeper than one serializedProperty somehow

How about this

Well, the SerializedObject / SerializedProperty construct is there to abstract the access to the serialized data. This allows out-of-the-box multi object editing support. An array of a custom serializable class is just serialized inline. So you can access an SerializedProperty from an array property using GetArrayElementAtIndex. This SerializedProperty represents the custom class itself. However you can not get a normal reference to such a class instance. Keep in mind the SerializedProperty is a proxy object just to represent the serialized data. Those custom serializable class instances are serialized inline inside the outer UnityEngine.Object (The SerializedObject the properties belong to).

From the array element you can use the usual iterator functionality of the SerializedProperty or use the FindPropertyRelative method to get access to a nested property of that class.

Note the story is different for fields that are marked with the new SerializeReference attribute. It allows you to store all sorts of native object trees (at least objects Unity can serialize) and even support inheritance for them. Here you would get access to the actual instance with managedReferenceValue. However as already mentioned, this only works with SerializeReference fields.