So this is the waypoints list code:
public List<Transform> waypoints;
and this is my custom inspector code:
using UnityEditor;
namespace Handlers.Pathing_Handler {
[CustomEditor(typeof(PathingHandler))]
public class PathingHandlerEditorButtons : Editor {
// Waypoints Array Reference
private SerializedProperty _waypoints;
private void OnEnable() {
// Waypoints Array Reference Initialization
_waypoints = serializedObject.FindProperty("waypoints");
}
public override void OnInspectorGUI() {
base.OnInspectorGUI();
EditorGUILayout.PropertyField(_waypoints);
serializedObject.ApplyModifiedProperties();
}
}
}
and this happens:
and if I open or close one they both open and close:
So when I try using [HideInInspector] on waypoints like this:
[HideInInspector] public List<Transform> waypoints;
they both vanish from the list just leaving a label named “Waypoints” as seen below:
So how do I use the Editor class to show the waypoints list only once? I need to do so through the Editor class because I’m doing everything else inspector related there and I want to control the order of everything.