public void Draw(UndoParentNode owner, CullMode cullMode)
        {
            bool foldoutValue = EditorVariablesManager.ExpandedStencilOptions.Value;

            NodeUtils.DrawPropertyGroup(ref foldoutValue, FoldoutLabelStr, () =>
            {
                m_reference = owner.EditorGUILayoutIntSlider(ReferenceValueContent, m_reference, 0, 255);
                m_readMask  = owner.EditorGUILayoutIntSlider(ReadMaskContent, m_readMask, 0, 255);
                m_writeMask = owner.EditorGUILayoutIntSlider(WriteMaskContent, m_writeMask, 0, 255);
                if (cullMode == CullMode.Off)
                {
                    m_comparisonFunctionIdx = owner.EditorGUILayoutPopup(ComparisonFrontStr, m_comparisonFunctionIdx, StencilBufferOpHelper.StencilComparisonLabels);
                    m_passStencilOpIdx      = owner.EditorGUILayoutPopup(PassFrontStr, m_passStencilOpIdx, StencilBufferOpHelper.StencilOpsLabels);
                    m_failStencilOpIdx      = owner.EditorGUILayoutPopup(FailFrontStr, m_failStencilOpIdx, StencilBufferOpHelper.StencilOpsLabels);
                    m_zFailStencilOpIdx     = owner.EditorGUILayoutPopup(ZFailFrontStr, m_zFailStencilOpIdx, StencilBufferOpHelper.StencilOpsLabels);
                    EditorGUILayout.Separator();
                    m_comparisonFunctionBackIdx = owner.EditorGUILayoutPopup(ComparisonBackStr, m_comparisonFunctionBackIdx, StencilBufferOpHelper.StencilComparisonLabels);
                    m_passStencilOpBackIdx      = owner.EditorGUILayoutPopup(PassBackStr, m_passStencilOpBackIdx, StencilBufferOpHelper.StencilOpsLabels);
                    m_failStencilOpBackIdx      = owner.EditorGUILayoutPopup(FailBackStr, m_failStencilOpBackIdx, StencilBufferOpHelper.StencilOpsLabels);
                    m_zFailStencilOpBackIdx     = owner.EditorGUILayoutPopup(ZFailBackStr, m_zFailStencilOpBackIdx, StencilBufferOpHelper.StencilOpsLabels);
                }
                else
                {
                    m_comparisonFunctionIdx = owner.EditorGUILayoutPopup(ComparisonStr, m_comparisonFunctionIdx, StencilBufferOpHelper.StencilComparisonLabels);
                    m_passStencilOpIdx      = owner.EditorGUILayoutPopup(PassStr, m_passStencilOpIdx, StencilBufferOpHelper.StencilOpsLabels);
                    m_failStencilOpIdx      = owner.EditorGUILayoutPopup(FailStr, m_failStencilOpIdx, StencilBufferOpHelper.StencilOpsLabels);
                    m_zFailStencilOpIdx     = owner.EditorGUILayoutPopup(ZFailStr, m_zFailStencilOpIdx, StencilBufferOpHelper.StencilOpsLabels);
                }
            });
            EditorVariablesManager.ExpandedStencilOptions.Value = foldoutValue;
        }
示例#2
0
 void DrawBlock(UndoParentNode owner, CullMode cullMode)
 {
     EditorGUI.BeginChangeCheck();
     {
         m_reference = owner.EditorGUILayoutIntSlider(ReferenceValueContent, m_reference, 0, 255);
         m_readMask  = owner.EditorGUILayoutIntSlider(ReadMaskContent, m_readMask, 0, 255);
         m_writeMask = owner.EditorGUILayoutIntSlider(WriteMaskContent, m_writeMask, 0, 255);
         if (cullMode == CullMode.Off)
         {
             m_comparisonFunctionIdx = owner.EditorGUILayoutPopup(ComparisonFrontStr, m_comparisonFunctionIdx, StencilBufferOpHelper.StencilComparisonLabels);
             m_passStencilOpIdx      = owner.EditorGUILayoutPopup(PassFrontStr, m_passStencilOpIdx, StencilBufferOpHelper.StencilOpsLabels);
             m_failStencilOpIdx      = owner.EditorGUILayoutPopup(FailFrontStr, m_failStencilOpIdx, StencilBufferOpHelper.StencilOpsLabels);
             m_zFailStencilOpIdx     = owner.EditorGUILayoutPopup(ZFailFrontStr, m_zFailStencilOpIdx, StencilBufferOpHelper.StencilOpsLabels);
             EditorGUILayout.Separator();
             m_comparisonFunctionBackIdx = owner.EditorGUILayoutPopup(ComparisonBackStr, m_comparisonFunctionBackIdx, StencilBufferOpHelper.StencilComparisonLabels);
             m_passStencilOpBackIdx      = owner.EditorGUILayoutPopup(PassBackStr, m_passStencilOpBackIdx, StencilBufferOpHelper.StencilOpsLabels);
             m_failStencilOpBackIdx      = owner.EditorGUILayoutPopup(FailBackStr, m_failStencilOpBackIdx, StencilBufferOpHelper.StencilOpsLabels);
             m_zFailStencilOpBackIdx     = owner.EditorGUILayoutPopup(ZFailBackStr, m_zFailStencilOpBackIdx, StencilBufferOpHelper.StencilOpsLabels);
         }
         else
         {
             m_comparisonFunctionIdx = owner.EditorGUILayoutPopup(ComparisonStr, m_comparisonFunctionIdx, StencilBufferOpHelper.StencilComparisonLabels);
             m_passStencilOpIdx      = owner.EditorGUILayoutPopup(PassStr, m_passStencilOpIdx, StencilBufferOpHelper.StencilOpsLabels);
             m_failStencilOpIdx      = owner.EditorGUILayoutPopup(FailStr, m_failStencilOpIdx, StencilBufferOpHelper.StencilOpsLabels);
             m_zFailStencilOpIdx     = owner.EditorGUILayoutPopup(ZFailStr, m_zFailStencilOpIdx, StencilBufferOpHelper.StencilOpsLabels);
         }
     }
     if (EditorGUI.EndChangeCheck())
     {
         m_isDirty = true;
     }
 }
        public void Draw(UndoParentNode owner, GUIStyle toolbarstyle)
        {
            bool foldoutValue = EditorVariablesManager.ExpandedStencilOptions.Value;

            NodeUtils.DrawPropertyGroup(owner, ref foldoutValue, ref m_active, FoldoutLabelStr, () =>
            {
                m_refValue  = owner.EditorGUILayoutIntSlider(ReferenceValueContent, m_refValue, 0, 255);
                m_readMask  = owner.EditorGUILayoutIntSlider(ReadMaskContent, m_readMask, 0, 255);
                m_writeMask = owner.EditorGUILayoutIntSlider(WriteMaskContent, m_writeMask, 0, 255);
                if ((owner as StandardSurfaceOutputNode).CurrentCullMode == CullMode.Off)
                {
                    m_comparisonFunctionIdx = owner.EditorGUILayoutPopup(ComparisonFrontStr, m_comparisonFunctionIdx, ComparisonLabels);
                    m_passStencilOpIdx      = owner.EditorGUILayoutPopup(PassFrontStr, m_passStencilOpIdx, StencilOpsLabels);
                    m_failStencilOpIdx      = owner.EditorGUILayoutPopup(FailFrontStr, m_failStencilOpIdx, StencilOpsLabels);
                    m_zFailStencilOpIdx     = owner.EditorGUILayoutPopup(ZFailFrontStr, m_zFailStencilOpIdx, StencilOpsLabels);
                    EditorGUILayout.Separator();
                    m_comparisonFunctionBackIdx = owner.EditorGUILayoutPopup(ComparisonBackStr, m_comparisonFunctionBackIdx, ComparisonLabels);
                    m_passStencilOpBackIdx      = owner.EditorGUILayoutPopup(PassBackStr, m_passStencilOpBackIdx, StencilOpsLabels);
                    m_failStencilOpBackIdx      = owner.EditorGUILayoutPopup(FailBackStr, m_failStencilOpBackIdx, StencilOpsLabels);
                    m_zFailStencilOpBackIdx     = owner.EditorGUILayoutPopup(ZFailBackStr, m_zFailStencilOpBackIdx, StencilOpsLabels);
                }
                else
                {
                    m_comparisonFunctionIdx = owner.EditorGUILayoutPopup(ComparisonStr, m_comparisonFunctionIdx, ComparisonLabels);
                    m_passStencilOpIdx      = owner.EditorGUILayoutPopup(PassStr, m_passStencilOpIdx, StencilOpsLabels);
                    m_failStencilOpIdx      = owner.EditorGUILayoutPopup(FailStr, m_failStencilOpIdx, StencilOpsLabels);
                    m_zFailStencilOpIdx     = owner.EditorGUILayoutPopup(ZFailStr, m_zFailStencilOpIdx, StencilOpsLabels);
                }
            });
            EditorVariablesManager.ExpandedStencilOptions.Value = foldoutValue;
        }
示例#4
0
        public void Draw(UndoParentNode owner, GUIStyle toolbarstyle)
        {
            bool foldoutValue = EditorVariablesManager.ExpandedStencilOptions.Value;

            NodeUtils.DrawPropertyGroup(owner, ref foldoutValue, ref m_active, FoldoutLabelStr, () =>
            {
                m_refValue              = owner.EditorGUILayoutIntSlider(ReferenceValueContent, m_refValue, 0, 255);
                m_readMask              = owner.EditorGUILayoutIntSlider(ReadMaskContent, m_readMask, 0, 255);
                m_writeMask             = owner.EditorGUILayoutIntSlider(WriteMaskContent, m_writeMask, 0, 255);
                m_comparisonFunctionIdx = owner.EditorGUILayoutPopup(ComparisonStr, m_comparisonFunctionIdx, ComparisonLabels);
                m_passStencilOpIdx      = owner.EditorGUILayoutPopup(PassStr, m_passStencilOpIdx, StencilOpsLabels);
                m_failStencilOpIdx      = owner.EditorGUILayoutPopup(FailStr, m_failStencilOpIdx, StencilOpsLabels);
                m_zFailStencilOpIdx     = owner.EditorGUILayoutPopup(ZFailStr, m_zFailStencilOpIdx, StencilOpsLabels);
            });
            EditorVariablesManager.ExpandedStencilOptions.Value = foldoutValue;
        }
示例#5
0
 public void IntSlider(ref UndoParentNode owner, GUIContent content, int min, int max)
 {
     if (!m_active)
     {
         EditorGUILayout.BeginHorizontal();
         m_value = owner.EditorGUILayoutIntSlider(content, (int)m_value, min, max);
         if (GUILayout.Button(UIUtils.FloatIntIconON, UIUtils.FloatIntPickerONOFF, GUILayout.Width(15), GUILayout.Height(15)))
         {
             m_active = !m_active;
         }
         EditorGUILayout.EndHorizontal();
     }
     else
     {
         DrawPicker(ref owner, content);
     }
 }
        public void Draw(UndoParentNode owner)
        {
            if (m_isVisible)
            {
                int lastOption = m_currentOption;
                EditorGUI.BeginChangeCheck();
                switch (m_options.UIWidget)
                {
                case AseOptionsUIWidget.Dropdown:
                {
                    m_currentOption = owner.EditorGUILayoutPopup(m_options.Name, m_currentOption, m_options.DisplayOptions);
                }
                break;

                case AseOptionsUIWidget.Toggle:
                {
                    m_currentOption = owner.EditorGUILayoutToggle(m_options.Name, m_currentOption == 1) ? 1 : 0;
                }
                break;

                case AseOptionsUIWidget.Float:
                {
                    if (m_options.FieldInline)
                    {
                        m_options.FieldValue.FloatField(ref owner, m_options.Name);
                        if (m_options.FieldValue.Active)
                        {
                            m_currentOption = 1;
                        }
                        else
                        {
                            m_currentOption = 0;
                        }
                    }
                    else
                    {
                        m_options.FieldValue.FloatValue = owner.EditorGUILayoutFloatField(m_options.Name, m_options.FieldValue.FloatValue);
                    }
                }
                break;

                case AseOptionsUIWidget.Int:
                {
                    if (m_options.FieldInline)
                    {
                        m_options.FieldValue.IntField(ref owner, m_options.Name);
                        if (m_options.FieldValue.Active)
                        {
                            m_currentOption = 1;
                        }
                        else
                        {
                            m_currentOption = 0;
                        }
                    }
                    else
                    {
                        m_options.FieldValue.FloatValue = owner.EditorGUILayoutIntField(m_options.Name, (int)m_options.FieldValue.FloatValue);
                    }
                }
                break;

                case AseOptionsUIWidget.FloatRange:
                {
                    if (m_options.FieldInline)
                    {
                        m_options.FieldValue.SliderField(ref owner, m_options.Name, m_options.FieldMin, m_options.FieldMax);
                        if (m_options.FieldValue.Active)
                        {
                            m_currentOption = 1;
                        }
                        else
                        {
                            m_currentOption = 0;
                        }
                    }
                    else
                    {
                        m_options.FieldValue.FloatValue = owner.EditorGUILayoutSlider(m_options.Name, m_options.FieldValue.FloatValue, m_options.FieldMin, m_options.FieldMax);
                    }
                }
                break;

                case AseOptionsUIWidget.IntRange:
                {
                    if (m_options.FieldInline)
                    {
                        m_options.FieldValue.IntSlider(ref owner, m_options.Name, (int)m_options.FieldMin, (int)m_options.FieldMax);
                        if (m_options.FieldValue.Active)
                        {
                            m_currentOption = 1;
                        }
                        else
                        {
                            m_currentOption = 0;
                        }
                    }
                    else
                    {
                        m_options.FieldValue.FloatValue = owner.EditorGUILayoutIntSlider(m_options.Name, (int)m_options.FieldValue.FloatValue, (int)m_options.FieldMin, (int)m_options.FieldMax);
                    }
                }
                break;
                }
                if (EditorGUI.EndChangeCheck())
                {
                    if (OnActionPerformedEvt != null)
                    {
                        if (m_invertActionOnDeselection)
                        {
                            OnActionPerformedEvt(false, lastOption != m_options.DisableIdx, this, m_options.ActionsPerOption[lastOption]);
                        }

                        OnActionPerformedEvt(false, false, this, m_options.ActionsPerOption[m_currentOption]);
                    }
                }
            }
        }