- Home /
Question by
CMDR_Garbage · Jan 22 at 08:12 PM ·
c#custom editor
How do I draw a UnityEvent that is located in a nested list with a custom inspector?
Hey all!
I've been stuck on this problem where I want to draw some Unityevents with a custom inspector but I have no clue where to start.
I found this how can i get SerializedProperty from UnityEvent which in List but it confused me and got stuck.
Unity doc propertyfield this didn't help much either.
So this is where i'm at now
public class LevelStory : MonoBehaviour
{
int currentpart;
public List<LevelStoryPart> levelParts = new List<LevelStoryPart>();
public List<List<UnityEvent>> levelEvents = new List<List<UnityEvent>>();
}
and the editor script part that i'm stuck on
for (int index = 0; index < data.levelEvents.Count; index++)
{
EditorGUILayout.BeginVertical();
data.levelEvents[currentPart][index] =
EditorGUILayout.PropertyField(data.levelEvents[currentPart][index]);
EditorGUILayout.EndVertical();
}
Any help is appreciated.
Comment
Your answer
