void DrawBlock( UndoParentNode owner, CullMode cullMode ) { bool guiEnabled = GUI.enabled: GUI.enabled = m_active: EditorGUI.BeginChangeCheck(): { m_reference.IntSlider( ref owner, ReferenceValueContent, 0, 255 ): m_readMask.IntSlider( ref owner, ReadMaskContent, 0, 255 ): m_writeMask.IntSlider( ref owner, WriteMaskContent, 0, 255 ): if( cullMode == CullMode.Off ) { m_comparisonFunctionFrontIdx.EnumTypePopup( ref owner, ComparisonFrontStr, StencilBufferOpHelper.StencilComparisonLabels ): m_passStencilOpFrontIdx.EnumTypePopup( ref owner, PassFrontStr, StencilBufferOpHelper.StencilOpsLabels ): m_failStencilOpFrontIdx.EnumTypePopup( ref owner, FailFrontStr, StencilBufferOpHelper.StencilOpsLabels ): m_zFailStencilOpFrontIdx.EnumTypePopup( ref owner, ZFailFrontStr, StencilBufferOpHelper.StencilOpsLabels ): EditorGUILayout.Separator(): m_comparisonFunctionBackIdx.EnumTypePopup( ref owner, ComparisonBackStr, StencilBufferOpHelper.StencilComparisonLabels ): m_passStencilOpBackIdx.EnumTypePopup( ref owner, PassBackStr, StencilBufferOpHelper.StencilOpsLabels ): m_failStencilOpBackIdx.EnumTypePopup( ref owner, FailBackStr, StencilBufferOpHelper.StencilOpsLabels ): m_zFailStencilOpBackIdx.EnumTypePopup( ref owner, ZFailBackStr, StencilBufferOpHelper.StencilOpsLabels ): } else { m_comparisonFunctionFrontIdx.EnumTypePopup( ref owner, ComparisonStr, StencilBufferOpHelper.StencilComparisonLabels ): m_passStencilOpFrontIdx.EnumTypePopup( ref owner, PassFrontStr, StencilBufferOpHelper.StencilOpsLabels ): m_failStencilOpFrontIdx.EnumTypePopup( ref owner, FailFrontStr, StencilBufferOpHelper.StencilOpsLabels ): m_zFailStencilOpFrontIdx.EnumTypePopup( ref owner, ZFailFrontStr, StencilBufferOpHelper.StencilOpsLabels ): } } if( EditorGUI.EndChangeCheck() ) { m_isDirty = true: } GUI.enabled = guiEnabled: }
public void Draw(UndoParentNode owner, GUIStyle toolbarstyle, bool customBlendAvailable) { Color cachedColor = GUI.color; GUI.color = new Color(cachedColor.r, cachedColor.g, cachedColor.b, 0.5f); EditorGUILayout.BeginHorizontal(toolbarstyle); GUI.color = cachedColor; EditorGUI.BeginChangeCheck(); m_parentSurface.ContainerGraph.ParentWindow.InnerWindowVariables.ExpandedDepth = owner.GUILayoutToggle(m_parentSurface.ContainerGraph.ParentWindow.InnerWindowVariables.ExpandedDepth, DepthParametersStr, UIUtils.MenuItemToggleStyle); if (EditorGUI.EndChangeCheck()) { EditorPrefs.SetBool("ExpandedDepth", m_parentSurface.ContainerGraph.ParentWindow.InnerWindowVariables.ExpandedDepth); } EditorGUILayout.EndHorizontal(); if (m_parentSurface.ContainerGraph.ParentWindow.InnerWindowVariables.ExpandedDepth) { cachedColor = GUI.color; GUI.color = new Color(cachedColor.r, cachedColor.g, cachedColor.b, (EditorGUIUtility.isProSkin ? 0.5f : 0.25f)); EditorGUILayout.BeginVertical(UIUtils.MenuItemBackgroundStyle); GUI.color = cachedColor; EditorGUI.indentLevel++; if (!customBlendAvailable) { EditorGUILayout.HelpBox("Depth Writing is only available for Opaque or Custom blend modes", MessageType.Warning); } EditorGUILayout.Separator(); EditorGUI.BeginDisabledGroup(!customBlendAvailable); m_zWriteMode.EnumTypePopup(ref owner, ZWriteModeStr, ZWriteModeValues); m_zTestMode.EnumTypePopup(ref owner, ZTestModeStr, ZTestModeLabels); //m_zWriteMode = owner.EditorGUILayoutPopup( ZWriteModeStr, m_zWriteMode, ZWriteModeValues ); //m_zTestMode = owner.EditorGUILayoutPopup( ZTestModeStr, m_zTestMode, ZTestModeLabels ); m_offsetEnabled = owner.EditorGUILayoutToggle(OffsetStr, m_offsetEnabled); if (m_offsetEnabled) { EditorGUI.indentLevel++; m_offsetFactor.FloatField(ref owner, OffsetFactorStr); m_offsetUnits.FloatField(ref owner, OffsetUnitsStr); EditorGUI.indentLevel--; } m_extraDepthPass = owner.EditorGUILayoutToggle(ExtraDepthPassStr, m_extraDepthPass); if (m_extraDepthPass) { EditorGUI.indentLevel++; m_extrazTestMode = owner.EditorGUILayoutPopup(DepthZTestStr, m_extrazTestMode, ZTestModeLabels); EditorGUI.indentLevel--; } EditorGUILayout.Separator(); EditorGUI.indentLevel--; EditorGUI.EndDisabledGroup(); EditorGUILayout.EndVertical(); } EditorGUI.EndDisabledGroup(); }
void DrawBlock(UndoParentNode owner, CullMode cullMode) { bool guiEnabled = GUI.enabled; GUI.enabled = m_active; EditorGUI.BeginChangeCheck(); { var cache = EditorGUIUtility.labelWidth; EditorGUIUtility.labelWidth = EditorGUIUtility.labelWidth - 20; m_reference.IntSlider(ref owner, ReferenceValueContent, 0, 255); m_readMask.IntSlider(ref owner, ReadMaskContent, 0, 255); m_writeMask.IntSlider(ref owner, WriteMaskContent, 0, 255); if (cullMode == CullMode.Off) { m_comparisonFunctionFrontIdx.EnumTypePopup(ref owner, ComparisonFrontStr, StencilBufferOpHelper.StencilComparisonLabels); m_passStencilOpFrontIdx.EnumTypePopup(ref owner, PassFrontStr, StencilBufferOpHelper.StencilOpsLabels); m_failStencilOpFrontIdx.EnumTypePopup(ref owner, FailFrontStr, StencilBufferOpHelper.StencilOpsLabels); m_zFailStencilOpFrontIdx.EnumTypePopup(ref owner, ZFailFrontStr, StencilBufferOpHelper.StencilOpsLabels); EditorGUILayout.Separator(); m_comparisonFunctionBackIdx.EnumTypePopup(ref owner, ComparisonBackStr, StencilBufferOpHelper.StencilComparisonLabels); m_passStencilOpBackIdx.EnumTypePopup(ref owner, PassBackStr, StencilBufferOpHelper.StencilOpsLabels); m_failStencilOpBackIdx.EnumTypePopup(ref owner, FailBackStr, StencilBufferOpHelper.StencilOpsLabels); m_zFailStencilOpBackIdx.EnumTypePopup(ref owner, ZFailBackStr, StencilBufferOpHelper.StencilOpsLabels); } else { m_comparisonFunctionFrontIdx.EnumTypePopup(ref owner, ComparisonStr, StencilBufferOpHelper.StencilComparisonLabels); m_passStencilOpFrontIdx.EnumTypePopup(ref owner, PassFrontStr, StencilBufferOpHelper.StencilOpsLabels); m_failStencilOpFrontIdx.EnumTypePopup(ref owner, FailFrontStr, StencilBufferOpHelper.StencilOpsLabels); m_zFailStencilOpFrontIdx.EnumTypePopup(ref owner, ZFailFrontStr, StencilBufferOpHelper.StencilOpsLabels); } EditorGUIUtility.labelWidth = cache; } if (EditorGUI.EndChangeCheck()) { m_isDirty = true; CustomEdited = true; } GUI.enabled = guiEnabled; }
public void Draw(UndoParentNode owner) { bool foldoutValue = owner.ContainerGraph.ParentWindow.InnerWindowVariables.ExpandedStencilOptions; NodeUtils.DrawPropertyGroup(owner, ref foldoutValue, ref m_active, FoldoutLabelStr, () => { float cache = EditorGUIUtility.labelWidth; float cache2 = EditorGUIUtility.fieldWidth; EditorGUIUtility.labelWidth = 110; EditorGUIUtility.fieldWidth = 30; m_refValue.IntSlider(ref owner, ReferenceValueContent, 0, 255); m_readMask.IntSlider(ref owner, ReadMaskContent, 0, 255); m_writeMask.IntSlider(ref owner, WriteMaskContent, 0, 255); //EditorGUIUtility.labelWidth = cache; EditorGUIUtility.fieldWidth = cache2; if ((owner as StandardSurfaceOutputNode).CurrentCullMode == CullMode.Off) { m_comparisonFunctionIdx.EnumTypePopup(ref owner, ComparisonFrontStr, StencilComparisonLabels); m_passStencilOpIdx.EnumTypePopup(ref owner, PassFrontStr, StencilOpsLabels); m_failStencilOpIdx.EnumTypePopup(ref owner, FailFrontStr, StencilOpsLabels); m_zFailStencilOpIdx.EnumTypePopup(ref owner, ZFailFrontStr, StencilOpsLabels); EditorGUILayout.Separator(); m_comparisonFunctionBackIdx.EnumTypePopup(ref owner, ComparisonBackStr, StencilComparisonLabels); m_passStencilOpBackIdx.EnumTypePopup(ref owner, PassBackStr, StencilOpsLabels); m_failStencilOpBackIdx.EnumTypePopup(ref owner, FailBackStr, StencilOpsLabels); m_zFailStencilOpBackIdx.EnumTypePopup(ref owner, ZFailBackStr, StencilOpsLabels); } else { m_comparisonFunctionIdx.EnumTypePopup(ref owner, ComparisonStr, StencilComparisonLabels); m_passStencilOpIdx.EnumTypePopup(ref owner, PassFrontStr, StencilOpsLabels); m_failStencilOpIdx.EnumTypePopup(ref owner, FailFrontStr, StencilOpsLabels); m_zFailStencilOpIdx.EnumTypePopup(ref owner, ZFailFrontStr, StencilOpsLabels); } EditorGUIUtility.labelWidth = cache; }); owner.ContainerGraph.ParentWindow.InnerWindowVariables.ExpandedStencilOptions = foldoutValue; }
void DrawBlock(UndoParentNode owner) { EditorGUI.BeginChangeCheck(); var cache = EditorGUIUtility.labelWidth; EditorGUIUtility.labelWidth = EditorGUIUtility.labelWidth - 20; Color cachedColor = GUI.color; GUI.color = new Color(cachedColor.r, cachedColor.g, cachedColor.b, (EditorGUIUtility.isProSkin ? 0.5f : 0.25f)); //EditorGUILayout.BeginVertical( UIUtils.MenuItemBackgroundStyle ); GUI.color = cachedColor; EditorGUILayout.Separator(); if (m_validZWrite) { m_zWriteMode.EnumTypePopup(ref owner, ZBufferOpHelper.ZWriteModeStr, ZBufferOpHelper.ZWriteModeValues); } if (m_validZTest) { m_zTestMode.EnumTypePopup(ref owner, ZBufferOpHelper.ZTestModeStr, ZBufferOpHelper.ZTestModeLabels); } if (m_validOffset) { m_offsetEnabled = owner.EditorGUILayoutToggle(ZBufferOpHelper.OffsetStr, m_offsetEnabled); if (m_offsetEnabled) { EditorGUI.indentLevel++; m_offsetFactor.FloatField(ref owner, ZBufferOpHelper.OffsetFactorStr); m_offsetUnits.FloatField(ref owner, ZBufferOpHelper.OffsetUnitsStr); EditorGUI.indentLevel--; } } EditorGUILayout.Separator(); EditorGUIUtility.labelWidth = cache; //EditorGUILayout.EndVertical(); if (EditorGUI.EndChangeCheck()) { m_isDirty = true; CustomEdited = true; } }
void DrawBlock( UndoParentNode owner ) { EditorGUI.BeginChangeCheck(): Color cachedColor = GUI.color: GUI.color = new Color( cachedColor.r, cachedColor.g, cachedColor.b, ( EditorGUIUtility.isProSkin ? 0.5f : 0.25f ) ): //EditorGUILayout.BeginVertical( UIUtils.MenuItemBackgroundStyle ): GUI.color = cachedColor: EditorGUILayout.Separator(): if( m_validZWrite ) m_zWriteMode.EnumTypePopup( ref owner, ZBufferOpHelper.ZWriteModeStr, ZBufferOpHelper.ZWriteModeValues ): if( m_validZTest ) m_zTestMode.EnumTypePopup( ref owner, ZBufferOpHelper.ZTestModeStr, ZBufferOpHelper.ZTestModeLabels ): if( m_validOffset ) { m_offsetEnabled = owner.EditorGUILayoutToggle( ZBufferOpHelper.OffsetStr, m_offsetEnabled ): if( m_offsetEnabled ) { EditorGUI.indentLevel++: m_offsetFactor.FloatField( ref owner , ZBufferOpHelper.OffsetFactorStr ): m_offsetUnits.FloatField( ref owner , ZBufferOpHelper.OffsetUnitsStr): EditorGUI.indentLevel--: } } EditorGUILayout.Separator(): //EditorGUILayout.EndVertical(): if( EditorGUI.EndChangeCheck() ) { m_isDirty = true: } }