protected override void OnConditionInspectorGUI()
        {
            base.OnConditionInspectorGUI();

            UpdateHandleMode();
            SetHandleVisibility();

            serializedObject.Update();

            using (var check = new EditorGUI.ChangeCheckScope())
            {
                EditorGUIUtils.PropertyField(m_MinBoundedProperty, m_MinElevationProperty, k_MinElevationLabel);
                EditorGUIUtils.PropertyField(m_MaxBoundedProperty, m_MaxElevationProperty, k_MaxElevationLabel);

                if (check.changed)
                {
                    if (m_HandleMode == HandleMode.Hidden)
                    {
                        m_HandleMode = HandleMode.Preview;
                    }

                    serializedObject.ApplyModifiedProperties();
                }
            }

            if (m_ElevationRelation.noMinMaxWarning)
            {
                EditorGUIUtils.Warning(k_NoMinOrMaxWarning);
            }
            if (m_ElevationRelation.smallMinMaxRangeWarning)
            {
                EditorGUIUtils.Warning(k_SmallMinMaxRangeWarning);
            }
        }
        protected override void OnConditionInspectorGUI()
        {
            UpdateHandleMode();
            SetHandleVisibility();

            using (var check = new EditorGUI.ChangeCheckScope())
            {
                EditorGUIUtils.PropertyField(m_MinBoundedProperty, m_MinSizeProperty);
                EditorGUIUtils.PropertyField(m_MaxBoundedProperty, m_MaxSizeProperty);

                MarsCompareTool.DrawComponentControls(m_PlaneSizeCondition);

                if (check.changed)
                {
                    if (m_HandleMode == HandleMode.Hidden)
                    {
                        m_HandleMode = HandleMode.Preview;
                    }

                    serializedObject.ApplyModifiedProperties();
                }
            }

            if (m_PlaneSizeCondition.noMinMaxWarning)
            {
                EditorGUIUtils.Warning(k_NoMinOrMaxWarning);
            }
            else if (m_PlaneSizeCondition.smallMinMaxRangeWarning)
            {
                EditorGUIUtils.Warning(k_SmallMinMaxRangeWarning);
            }
        }
        static void ShowSubRelationEditor(SerializedPropertyData subRelation, GUIContent label)
        {
            if (subRelation == null)
            {
                return;
            }

            EditorGUIUtils.PropertyField(subRelation, label, true);
        }
Exemple #4
0
        public override void OnInspectorGUI()
        {
            if (isDirty)
            {
                CleanUp();
            }

            serializedObject.Update();

            Rect dropdownButtonRect;

            using (var check = new EditorGUI.ChangeCheckScope())
            {
                using (new EditorGUILayout.HorizontalScope())
                {
                    EditorGUIUtils.PropertyField(m_TraitNameProperty);
                    dropdownButtonRect = GUILayoutUtility.GetRect(k_KnownTagsButtonWidth, k_KnownTagsButtonWidth);
                }

                if (check.changed)
                {
                    DoTraitNameChanged();
                }
            }

            dropdownButtonRect.width = k_KnownTagsButtonWidth;
            const int dropdownButtonVerticalPadding = 1;

            dropdownButtonRect.y += dropdownButtonVerticalPadding;
            if (EditorGUI.DropdownButton(dropdownButtonRect, GUIContent.none, FocusType.Passive))
            {
                var dropdown = new KnownTraitsDropdown(null,
                                                       serializedObject.targetObject as SemanticTagCondition, DoTraitNameChanged);

                dropdown.Show(dropdownButtonRect);
            }

            EditorGUIUtils.PropertyField(m_MatchRuleProperty);

            MarsCompareTool.DrawComponentControls(target as SemanticTagCondition);

            serializedObject.ApplyModifiedProperties();
        }
Exemple #5
0
        protected override void OnConditionInspectorGUI()
        {
            base.OnConditionInspectorGUI();

            UpdateHandleMode();
            SetHandleVisibility();

            serializedObject.Update();

            using (var check = new EditorGUI.ChangeCheckScope())
            {
                EditorGUIUtils.PropertyField(m_MinBoundedProperty, m_MinDistanceProperty, k_MinDistanceLabel);
                EditorGUIUtils.PropertyField(m_MaxBoundedProperty, m_MaxDistanceProperty, k_MaxDistanceLabel);
                EditorGUIUtils.PropertyField(m_AxisMaskProperty, m_AxisMaskProperty, k_AxisMaskLabel);

                if (check.changed)
                {
                    serializedObject.ApplyModifiedProperties();
                }
            }
        }
        /// <summary>
        /// Draws the parameters with the default parameter property drawer in the inspector.
        /// </summary>
        public void DrawDefaultInspector()
        {
            if (isDirty)
            {
                CleanUp();
            }

            using (var check = new EditorGUI.ChangeCheckScope())
            {
                foreach (var parameter in m_Parameters)
                {
                    EditorGUIUtils.PropertyField(parameter, false, false);
                }

                if (check.changed)
                {
                    serializedObject.ApplyModifiedProperties();
                    isDirty = true;
                }
            }
        }