Hello everyone. I’m trying to create a custom inspector that has a List and inside this list contains elements where each element is a serializable struct that I defined. So for example, I will define a public Serializable struct called TransformSpawnPoints which contains 2 properties: the transformSpawnPoint and the initial velocity that it has. I will then define a list whose type is this struct. I removed all the functionality that doesn’t pertain to my question for complexity sake. Here is the bare bones version of what my class looks like:
ObstacleSpawnee Class:
using System;
using System.Collections.Generic;
using UnityEngine;
public class ObstacleSpawnee : MonoBehaviour
{
//Inspector
[SerializeField] [HideInInspector]
private List<TransformSpawnPoints> _possibleTransformSpawnPoints;
}
[Serializable]
public struct TransformSpawnPoints
{
[SerializeField]
private Transform transformSpawnPoint;
[SerializeField]
public Vector2 initialVelocity;
}
This will create a list where each element should have the transformSpawnPoint and initial velocity properties. Without a custom inspector this works fine and it looks like this.

The issue is I want to be able to do this in a custom inspector because I want to add a few tweaks that wouldn’t be possible without it. However, when I try to do this using a custom inspector the list still shows up, but the serializable public struct I created is ignored and it just shows me a list of blank elements that I’m unable to modify. It looks like this:

Can somebody explain to me why the custom inspector is unable to see this struct and how I would go about resolving this? My custom inspector code is shown below. Thanks
ObstacleSpawnee_Editor Class:
using UnityEditor;
#if UNITY_EDITOR
[CustomEditor(typeof(ObstacleSpawnee))]
public class ObstacleSpawnee_Editor : Editor
{
private SerializedProperty possibleTransformSpawnPoints;
void OnEnable()
{
possibleTransformSpawnPoints = serializedObject.FindProperty("_possibleTransformSpawnPoints");
}
public override void OnInspectorGUI()
{
serializedObject.Update();
EditorGUILayout.PropertyField(possibleTransformSpawnPoints);
serializedObject.ApplyModifiedProperties();
}
}
#endif