I don’t know if I worded it correctly but I hope you get it.
I have a Dialogue class that among other things contains boolean value ‘isOptionDialogue’ and array of serialized DialogOption class objects that contain int and string value. Code looks like so:
public class Dialogue : MonoBehaviour
{
//some other stuff
public bool isOptionDialogue;
public DialogOption[] dialogOptions;
}
[Serializable]
public class DialogOption
{
public int targetIndex;
public string optionSentence;
}
and it shows in the inspectior like so:
But I want to make it so it only shows Dialog Options when bool IsOptionDialogue is set to true.
Is false:
Is true:
I am really bad with UnityEditor stuff. I followed some sample code I found and tried doing something by overriding OnInspectorGUI() and drawing things with EditorGUILayout but I only got it to work with simple variables. I have no idea how to draw an array of serialized class objects. Please help