protected override void OnEnable()
 {
     base.OnEnable();
     if (m_actionListDrawer == null)
     {
         m_actionListDrawer = new QuestActionListInspectorGUI(new GUIContent("Actions", "Actions that run when this button is clicked."));
     }
     m_groupToggleGUIContent = new GUIContent("Group Selection", "This button belongs to a group. When one button in the group is clicked, all buttons are deactivated. Typically used for reward selection.");
 }
        public void Draw(SerializedObject serializedObject, SerializedProperty stateInfoProperty, int nodeIndex, QuestState questState)
        {
            if (serializedObject == null || stateInfoProperty == null)
            {
                return;
            }

            var foldout    = QuestEditorPrefs.GetQuestStateFoldout(questState, nodeIndex);
            var newFoldout = QuestEditorUtility.EditorGUILayoutFoldout(questState.ToString(), string.Empty, foldout, false);

            if (newFoldout != foldout)
            {
                QuestEditorPrefs.ToggleQuestStateFoldout(questState, nodeIndex);
            }
            if (!newFoldout)
            {
                return;
            }

            if (m_categorizedContentDrawer == null)
            {
                m_categorizedContentDrawer = new CategorizedQuestContentInspectorGUI();
            }
            if (m_questActionListDrawer == null)
            {
                m_questActionListDrawer = new QuestActionListInspectorGUI(new GUIContent("Actions", "Actions that run when the quest enters this state."));
            }
            QuestEditorUtility.EditorGUILayoutBeginIndent();

            var categorizedContentListProperty = stateInfoProperty.FindPropertyRelative("m_categorizedContentList");

            m_categorizedContentDrawer.Draw(serializedObject, categorizedContentListProperty);

            var actionListProperty = stateInfoProperty.FindPropertyRelative("m_actionList");

            m_questActionListDrawer.Draw(actionListProperty);

            QuestEditorUtility.EditorGUILayoutEndIndent();
            EditorGUILayout.Space();
        }