Exemplo n.º 1
0
        private void RuleInfoGUI()
        {
            if (m_SelectionState.Rule == null)
            {
                return;
            }

            if (m_SelectionState.Rule.Conditions == null)
            {
                m_TargetState.UndoTarget.MarkDirty("Initialized Conditions");
                m_SelectionState.Rule.Conditions = new RSConditionData[0];
            }

            if (m_SelectionState.Rule.Actions == null)
            {
                m_TargetState.UndoTarget.MarkDirty("Initialized Actions");
                m_SelectionState.Rule.Actions = new RSActionData[0];
            }

            RuleGUILayout.RuleData(m_TargetState.UndoTarget, m_SelectionState.Rule, m_SelectionState.Table, GetBaseFlags(), m_Context);

            EditorGUILayout.Separator();

            m_ScrollState.RuleScroll = GUILayout.BeginScrollView(m_ScrollState.RuleScroll, false, false);
            {
                EditorGUILayout.LabelField(Content.RuleConditionListLabel, RSGUIStyles.SubHeaderStyle);

                if (m_ConditionList == null)
                {
                    ConfigureConditionList(m_SelectionState.Rule, ref m_ConditionList);
                }

                m_ConditionList.array = m_SelectionState.Rule.Conditions;
                m_ConditionList.DoLayout();
                using (new EditorGUI.DisabledScope(m_SelectionState.Rule.Conditions.Length == 0))
                {
                    Subset currentSubset = m_SelectionState.Rule.ConditionSubset;
                    Subset nextSubset    = (Subset)EditorGUILayout.EnumPopup(Content.RuleConditionSubsetLabel, currentSubset);
                    if (currentSubset != nextSubset)
                    {
                        m_TargetState.UndoTarget.MarkDirty("Changed Rule Conditions Subset");
                        m_SelectionState.Rule.ConditionSubset = nextSubset;
                    }
                }

                EditorGUILayout.Separator();

                EditorGUILayout.LabelField(Content.RuleActionListLabel, EditorStyles.boldLabel);

                if (m_ActionList == null)
                {
                    ConfigureActionList(m_SelectionState.Rule, ref m_ActionList);
                }

                m_ActionList.array = m_SelectionState.Rule.Actions;
                m_ActionList.DoLayout();
            }
            GUILayout.EndScrollView();
        }
Exemplo n.º 2
0
        private void ActionInfoGUI()
        {
            if (m_SelectionState.Action == null)
            {
                return;
            }

            m_ScrollState.ElementInspectorScroll = GUILayout.BeginScrollView(m_ScrollState.ElementInspectorScroll, false, false);
            {
                RSValidationContext context = m_Context.WithTrigger(GetCurrentTrigger());
                RuleGUILayout.ActionData(m_TargetState.UndoTarget, m_SelectionState.Action, GetBaseFlags(), context);
            }
            GUILayout.EndScrollView();
        }