I’m not sure what you mean by “CustomWindow”. Do you mean inside an EditorWindow or inside a CustomEditor (which is a custom inspector)?
Apart from that this line makes not much sense:
ScriptableObject target = this;
That would mean you are inspecting a ScriptableObject and not your MonoBehaviour.
Furthermore your MonoBehaviour class named “Script” is actually empty. It doesn’t has any variables. Your nested class “CustomClass” is just a class definition. It has no relation to it’s containing class To actually have an instance of that class you need a variable inside the “Script” class. For example:
public class Script: MonoBehaviour
{
public CustomClass someVariable;
[System.Serializable]
public class CustomClass {
public GameObject[] goArray;
}
}
Now Script has someVariable which is an instance of your CustomClass. To use the SerializedObject to access the array in an editor script you would do something like:
SerializedObject so = new SerializedObject(yourScriptInstance);
SerializedProperty property = so.FindProperty("someVariable.goArray");
SerializedProperty elementAtIndex1 = property.GetArrayElementAtIndex(1);
Debug.Log("Name of the second element:" +elementAtIndex1.objectReferenceValue.name);
It’s still not clear what you want to do but i hope this clears some questions you had.