Display list of objects in the editor window like it would if the list of objects were serialized in the inspector
public void setMatchSound()
{
EditorGUILayout.Space(15);
guiStyle.fontSize = 20;
guiStyle.alignment = TextAnchor.MiddleLeft;
guiStyle.normal.textColor = Color.white;
guiStyle.font = EditorStyles.boldFont;
GUILayout.Label("Match Sounds", guiStyle);
victory = (AudioClip) EditorGUILayout.ObjectField("Label", victory, typeof(AudioClip), false);
}
I want to add a list in the editor window (Similar to as if the object was in a serialized field in the inspector) that would allow the user to add more objects of this type or remove them, similar to how it would work if one were to do it in the inspector. If the code I've provided you can see a like that starts with "victory = (AudioClip) EditorGUILayout.ObjectField("Label", victory, typeof(AudioClip), false);" victory is a list of AudioClip components but when I run this code it does not seem to work the same way. I need help and I don't know how to fix this.
Your answer
Follow this Question
Related Questions
Unity Editor - Group Public GameObjects 0 Answers
UIElements - Horizontal scrolling is not working in ScrollView even with ScrollViewMode.Horizontal. 0 Answers
Creating an Inspector view that only changes on scene hierarchy selection or asset selection 1 Answer
custom EditorWindow - make settings persist 0 Answers
Access an Array of class inside another Array of class? (EditorGUILayout) 1 Answer