public void OnGUI()
        {
            if (m_BindingProperty == null)
            {
                return;
            }

            EditorGUILayout.BeginVertical();

            m_GeneralFoldout = DrawFoldout(s_GeneralContent, m_GeneralFoldout);

            if (m_GeneralFoldout)
            {
                EditorGUI.indentLevel++;

                var pathProperty = m_BindingProperty.FindPropertyRelative("path");
                DrawBindingGUI(pathProperty, ref m_ManualPathEditMode, m_ControlPickerTreeViewState,
                               s =>
                {
                    m_ManualPathEditMode = false;
                    OnBindingModified(s);
                });

                EditorGUI.indentLevel--;
            }

            EditorGUILayout.Space();
            m_InteractionsFoldout = DrawFoldout(s_InteractionsContent, m_InteractionsFoldout);

            if (m_InteractionsFoldout)
            {
                EditorGUI.indentLevel++;
                m_InteractionsList.OnGUI();
                EditorGUI.indentLevel--;
            }

            EditorGUILayout.Space();
            m_ProcessorsFoldout = DrawFoldout(s_ProcessorsContent, m_ProcessorsFoldout);

            if (m_ProcessorsFoldout)
            {
                EditorGUI.indentLevel++;
                m_ProcessorsListView.OnGUI();
                EditorGUI.indentLevel--;
            }

            GUILayout.FlexibleSpace();

            EditorGUILayout.EndVertical();
        }
Esempio n. 2
0
        public void OnGUI()
        {
            if (m_BindingProperty == null)
            {
                return;
            }

            EditorGUILayout.BeginVertical();

            m_GeneralFoldout = DrawFoldout(m_GeneralContent, m_GeneralFoldout);

            if (m_GeneralFoldout)
            {
                EditorGUI.indentLevel++;

                EditorGUILayout.BeginHorizontal();

                var lineRect  = GUILayoutUtility.GetRect(0, EditorGUIUtility.singleLineHeight);
                var labelRect = lineRect;
                labelRect.width = 60;
                EditorGUI.LabelField(labelRect, m_BindingGUI);
                lineRect.x     += 65;
                lineRect.width -= 65;

                var btnRect = lineRect;
                var editBtn = lineRect;
                btnRect.width -= 20;
                editBtn.x     += btnRect.width;
                editBtn.width  = 20;
                editBtn.height = 15;

                var pathProperty = m_BindingProperty.FindPropertyRelative("path");
                DrawBindingField(btnRect, editBtn, pathProperty);

                EditorGUILayout.EndHorizontal();
                EditorGUI.indentLevel--;
            }

            EditorGUILayout.Space();
            m_InteractionsFoldout = DrawFoldout(m_InteractionsContent, m_InteractionsFoldout);

            if (m_InteractionsFoldout)
            {
                EditorGUI.indentLevel++;
                m_InteractionsList.OnGUI();
                EditorGUI.indentLevel--;
            }

            EditorGUILayout.Space();
            m_ProcessorsFoldout = DrawFoldout(m_ProcessorsContent, m_ProcessorsFoldout);

            if (m_ProcessorsFoldout)
            {
                EditorGUI.indentLevel++;
                m_ProcessorsListView.OnGUI();
                EditorGUI.indentLevel--;
            }

            GUILayout.FlexibleSpace();

            EditorGUILayout.EndVertical();
        }