Custom Editor for array of custom class

Hello Unity Community,

I’m quite new to Unity, particularly with custom editors.

I have a class “node” :

using UnityEngine;
using System.Collections;
    
[System.Serializable]
public class Node
{
	public enum TypeEvent { Click, DragnDrop, Timer };

	public TypeEvent eventTrigger = TypeEvent.Click;
	public int originState = 0;
	public int destinationState = 1;
    
	public string requirement = "";
	public int delay = -1;
	// And some other properties
	// ...
}

Another class InteractiveGameObject :

using UnityEngine;
using System.Collections;
using System.Collections.Generic;

[System.Serializable]
public class InteractiveGameObject : MonoBehaviour
{

public int initialState;

public int nbStates;

public Node[] nodeArray;

// And more things ...

}

And I’d like to make a custom editor to edit properties of InteractiveGameObject, and have a custom editor for each node, but having something similar to classic array editor (length, folding, add and remove of elements).

The default editor allows me to handle the number of nodes, and properties of each, but i’d like to have conditionnal display of properties of my node relatively to which eventTrigger I choose.

If anyone can help, thanks in advance !

You could use a custom Property Drawer for your InteractiveGameObject class. A property drawer lets you customize the look of a serializable class. There is a good tutorial at Custom Data, a Unity C# Editor Tutorial