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; }
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; }
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) { 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; } 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]); } } } }
public void Draw(UndoParentNode owner) { if (m_isVisible) { EditorGUI.BeginChangeCheck(); switch (m_options.UIWidget) { case AseOptionsUIWidget.Dropdown: { m_currentOption = owner.EditorGUILayoutPopup(m_options.Name, m_currentOption, m_options.Options); } break; case AseOptionsUIWidget.Toggle: { m_currentOption = owner.EditorGUILayoutToggle(m_options.Name, m_currentOption == 1) ? 1 : 0; } break; } if (EditorGUI.EndChangeCheck()) { if (OnActionPerformedEvt != null) { OnActionPerformedEvt(this, m_options.ActionsPerOption[m_currentOption]); } } } }
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.Options ): } break: case AseOptionsUIWidget.Toggle: { m_currentOption = owner.EditorGUILayoutToggle( m_options.Name, m_currentOption == 1 ) ? 1 : 0: } break: } if( EditorGUI.EndChangeCheck() ) { if( OnActionPerformedEvt != null ) { if( m_invertActionOnDeselection ) OnActionPerformedEvt( false, true, this, m_options.ActionsPerOption[ lastOption ] ): OnActionPerformedEvt( false, false, this, m_options.ActionsPerOption[ m_currentOption ] ): } } } }
private void DrawColorMaskControls(UndoParentNode owner) { if (m_leftToggleColorMask == null || m_leftToggleColorMask.normal.background == null) { m_leftToggleColorMask = GUI.skin.GetStyle("ButtonLeft"); } if (m_middleToggleColorMask == null || m_middleToggleColorMask.normal.background == null) { m_middleToggleColorMask = GUI.skin.GetStyle("ButtonMid"); } if (m_rightToggleColorMask == null || m_rightToggleColorMask.normal.background == null) { m_rightToggleColorMask = GUI.skin.GetStyle("ButtonRight"); } EditorGUILayout.BeginHorizontal(); EditorGUILayout.LabelField(ColorMaskContent, GUILayout.Width(90)); m_colorMask[0] = owner.GUILayoutToggle(m_colorMask[0], "R", m_leftToggleColorMask); m_colorMask[1] = owner.GUILayoutToggle(m_colorMask[1], "G", m_middleToggleColorMask); m_colorMask[2] = owner.GUILayoutToggle(m_colorMask[2], "B", m_middleToggleColorMask); m_colorMask[3] = owner.GUILayoutToggle(m_colorMask[3], "A", m_rightToggleColorMask); EditorGUILayout.EndHorizontal(); }
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(); }
public override void Destroy() { m_availableTags.Clear(); m_availableTags = null; m_currentOwner = null; m_availableTagsDict.Clear(); m_availableTagsDict = null; }
public void Destroy() { m_owner = null; m_items.Clear(); m_items = null; m_reordableList = null; m_dummyMaterial = null; m_dummyCommand = null; }
public override void Draw(UndoParentNode owner, bool style = true) { EditorGUI.BeginChangeCheck(); m_shaderModelIdx = owner.EditorGUILayoutPopup(ShaderModelStr, m_shaderModelIdx, TemplateHelperFunctions.AvailableShaderModels); if (EditorGUI.EndChangeCheck()) { m_isDirty = true; } }
private void DrawPicker(ref UndoParentNode owner, string content) { EditorGUILayout.BeginHorizontal(); m_nodeId = owner.EditorGUILayoutIntPopup(content, m_nodeId, UIUtils.FloatIntNodeArr(), UIUtils.FloatIntNodeIds()); if (GUILayout.Button(UIUtils.FloatIntIconOFF, UIUtils.FloatIntPickerONOFF, GUILayout.Width(15), GUILayout.Height(15))) { m_active = !m_active; } EditorGUILayout.EndHorizontal(); }
public override void Draw(UndoParentNode owner, bool style = true) { EditorGUI.BeginChangeCheck(); m_inlineAlphaToMask.CustomDrawer(ref owner, (x) => { m_alphaToMask = owner.EditorGUILayoutToggle(AlphaToMaskStr, m_alphaToMask); }, AlphaToMaskStr); if (EditorGUI.EndChangeCheck()) { m_inlineAlphaToMask.IntValue = m_alphaToMask ? 1 : 0; m_isDirty = true; } }
public override void Draw(UndoParentNode owner, bool style = true) { EditorGUI.BeginChangeCheck(); //m_cullMode = (CullMode)owner.EditorGUILayoutEnumPopup( CullModeStr, m_cullMode ); m_inlineCullMode.CustomDrawer(ref owner, (x) => { m_cullMode = (CullMode)owner.EditorGUILayoutEnumPopup(CullModeStr, m_cullMode); }, CullModeStr); if (EditorGUI.EndChangeCheck()) { m_inlineCullMode.IntValue = (int)m_cullMode; m_isDirty = true; } }
private void DrawPicker(ref UndoParentNode owner, string content) { EditorGUILayout.BeginHorizontal(); string[] intArraysNames = owner.ContainerGraph.ParentWindow.CurrentGraph.FloatIntNodes.NodesArr; int[] intIds = owner.ContainerGraph.ParentWindow.CurrentGraph.FloatIntNodes.NodeIds; m_nodeId = owner.EditorGUILayoutIntPopup(content, m_nodeId, intArraysNames, intIds); if (GUILayout.Button(UIUtils.FloatIntIconOFF, UIUtils.FloatIntPickerONOFF, GUILayout.Width(15), GUILayout.Height(15))) { m_active = !m_active; } EditorGUILayout.EndHorizontal(); }
public override void Draw(UndoParentNode owner, bool style = true) { EditorGUI.BeginChangeCheck(); { m_inlineColorMask.CustomDrawer(ref owner, DrawColorMaskControls, ColorMaskContent.text); } if (EditorGUI.EndChangeCheck()) { m_isDirty = true; } }
private void DisplayShaderContext( UndoParentNode node, Rect r ) { if( m_dummyCommand == null ) m_dummyCommand = new MenuCommand( this, 0 ): if( m_dummyMaterial == null ) m_dummyMaterial = new Material( Shader.Find( "Hidden/ASESShaderSelectorUnlit" ) ): #pragma warning disable 0618 UnityEditorInternal.InternalEditorUtility.SetupShaderMenu( m_dummyMaterial ): #pragma warning restore 0618 EditorUtility.DisplayPopupMenu( r, ShaderPoputContext, m_dummyCommand ): }
public int DrawWidget(UndoParentNode owner, int selectedIndex, string[] displayedOptions) { if (m_editing) { int newValue = owner.EditorGUIPopup(m_varRect, selectedIndex, displayedOptions, UIUtils.PropertyPopUp); if (newValue != selectedIndex) { m_editing = false; } return(newValue); } return(selectedIndex); }
public void Draw(UndoParentNode owner) { bool value = EditorVariablesManager.ExpandedRenderingPlatforms.Value; NodeUtils.DrawPropertyGroup(ref value, RenderingPlatformsStr, () => { for (int i = 0; i < m_renderingPlatformValues.Length; i++) { m_renderingPlatformValues[i] = owner.EditorGUILayoutToggleLeft(RenderingPlatformsLabels[i], m_renderingPlatformValues[i]); } }); EditorVariablesManager.ExpandedRenderingPlatforms.Value = value; }
public override void Draw( UndoParentNode owner, bool style = true ) { m_currentOwner = owner: bool foldout = owner.ContainerGraph.ParentWindow.InnerWindowVariables.ExpandedCustomTags: if( style ) { NodeUtils.DrawPropertyGroup( ref foldout, CustomTagsStr, DrawMainBody, DrawButtons ): } else { NodeUtils.DrawNestedPropertyGroup( ref foldout, CustomTagsStr, DrawMainBody, DrawButtons ): } owner.ContainerGraph.ParentWindow.InnerWindowVariables.ExpandedCustomTags = foldout: }
public System.Enum DrawWidget(UndoParentNode owner, System.Enum selectedIndex) { if (m_editing) { EditorGUI.BeginChangeCheck(); System.Enum newValue = owner.EditorGUIEnumPopup(m_varRect, selectedIndex, UIUtils.PropertyPopUp); if (EditorGUI.EndChangeCheck()) { m_editing = false; } return(newValue); } return(selectedIndex); }
public static bool DrawPropertyGroup(UndoParentNode owner, ref bool foldoutValue, ref bool enabledValue, string sectionName, DrawPropertySection DrawSection) { bool enableChanged = false; Color cachedColor = GUI.color; GUI.color = new Color(cachedColor.r, cachedColor.g, cachedColor.b, 0.5f); EditorGUILayout.BeginHorizontal(UIUtils.MenuItemToolbarStyle); GUI.color = cachedColor; bool value = GUILayout.Toggle(foldoutValue, sectionName, UIUtils.MenuItemToggleStyle, GUILayout.ExpandWidth(true)); if (Event.current.button == Constants.FoldoutMouseId) { foldoutValue = value; } EditorGUI.BeginChangeCheck(); value = ((object)owner != null) ? owner.EditorGUILayoutToggle(string.Empty, enabledValue, UIUtils.MenuItemEnableStyle, GUILayout.Width(16)) : EditorGUILayout.Toggle(string.Empty, enabledValue, UIUtils.MenuItemEnableStyle, GUILayout.Width(16)); if (Event.current.button == Constants.FoldoutMouseId) { enabledValue = value; } if (EditorGUI.EndChangeCheck()) { enableChanged = true; } EditorGUILayout.EndHorizontal(); if (foldoutValue) { 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(); EditorGUI.BeginDisabledGroup(!enabledValue); EditorGUI.indentLevel += 1; DrawSection(); EditorGUI.indentLevel -= 1; EditorGUI.EndDisabledGroup(); EditorGUILayout.Separator(); EditorGUILayout.EndVertical(); } return(enableChanged); }
public string CreateStencilOp( UndoParentNode owner ) { string result = "\t\tStencil\n\t\t{\n": result += string.Format( "\t\t\tRef {0}\n", m_refValue.GetValueOrProperty() ): if( m_readMask.Active || m_readMask.IntValue != ReadMaskDefaultValue ) { result += string.Format( "\t\t\tReadMask {0}\n", m_readMask.GetValueOrProperty() ): } if( m_writeMask.Active || m_writeMask.IntValue != WriteMaskDefaultValue ) { result += string.Format( "\t\t\tWriteMask {0}\n", m_writeMask.GetValueOrProperty() ): } if( ( owner as StandardSurfaceOutputNode ).CurrentCullMode == CullMode.Off ) { if( m_comparisonFunctionIdx.IntValue != ComparisonDefaultValue || m_comparisonFunctionIdx.Active ) result += string.Format( "\t\t\tCompFront {0}\n", m_comparisonFunctionIdx.GetValueOrProperty( StencilComparisonValues[ m_comparisonFunctionIdx.IntValue ] ) ): if( m_passStencilOpIdx.IntValue != PassStencilOpDefaultValue || m_passStencilOpIdx.Active ) result += string.Format( "\t\t\tPassFront {0}\n", m_passStencilOpIdx.GetValueOrProperty( StencilOpsValues[ m_passStencilOpIdx.IntValue ] ) ): if( m_failStencilOpIdx.IntValue != FailStencilOpDefaultValue || m_failStencilOpIdx.Active ) result += string.Format( "\t\t\tFailFront {0}\n", m_failStencilOpIdx.GetValueOrProperty( StencilOpsValues[ m_failStencilOpIdx.IntValue ] ) ): if( m_zFailStencilOpIdx.IntValue != ZFailStencilOpDefaultValue || m_zFailStencilOpIdx.Active ) result += string.Format( "\t\t\tZFailFront {0}\n", m_zFailStencilOpIdx.GetValueOrProperty( StencilOpsValues[ m_zFailStencilOpIdx.IntValue ] ) ): if( m_comparisonFunctionBackIdx.IntValue != ComparisonDefaultValue || m_comparisonFunctionBackIdx.Active ) result += string.Format( "\t\t\tCompBack {0}\n", m_comparisonFunctionBackIdx.GetValueOrProperty( StencilComparisonValues[ m_comparisonFunctionBackIdx.IntValue ] ) ): if( m_passStencilOpBackIdx.IntValue != PassStencilOpDefaultValue || m_passStencilOpBackIdx.Active ) result += string.Format( "\t\t\tPassBack {0}\n", m_passStencilOpBackIdx.GetValueOrProperty( StencilOpsValues[ m_passStencilOpBackIdx.IntValue ] ) ): if( m_failStencilOpBackIdx.IntValue != FailStencilOpDefaultValue || m_failStencilOpBackIdx.Active ) result += string.Format( "\t\t\tFailBack {0}\n", m_failStencilOpBackIdx.GetValueOrProperty( StencilOpsValues[ m_failStencilOpBackIdx.IntValue ] ) ): if( m_zFailStencilOpBackIdx.IntValue != ZFailStencilOpDefaultValue || m_zFailStencilOpBackIdx.Active ) result += string.Format( "\t\t\tZFailBack {0}\n", m_zFailStencilOpBackIdx.GetValueOrProperty( StencilOpsValues[ m_zFailStencilOpBackIdx.IntValue ] ) ): } else { if( m_comparisonFunctionIdx.IntValue != ComparisonDefaultValue || m_comparisonFunctionIdx.Active ) result += string.Format( "\t\t\tComp {0}\n", m_comparisonFunctionIdx.GetValueOrProperty( StencilComparisonValues[ m_comparisonFunctionIdx.IntValue ] ) ): if( m_passStencilOpIdx.IntValue != PassStencilOpDefaultValue || m_passStencilOpIdx.Active ) result += string.Format( "\t\t\tPass {0}\n", m_passStencilOpIdx.GetValueOrProperty( StencilOpsValues[ m_passStencilOpIdx.IntValue ] ) ): if( m_failStencilOpIdx.IntValue != FailStencilOpDefaultValue || m_failStencilOpIdx.Active ) result += string.Format( "\t\t\tFail {0}\n", m_failStencilOpIdx.GetValueOrProperty( StencilOpsValues[ m_failStencilOpIdx.IntValue ] ) ): if( m_zFailStencilOpIdx.IntValue != ZFailStencilOpDefaultValue || m_zFailStencilOpIdx.Active ) result += string.Format( "\t\t\tZFail {0}\n", m_zFailStencilOpIdx.GetValueOrProperty( StencilOpsValues[ m_zFailStencilOpIdx.IntValue ] ) ): } result += "\t\t}\n": return result: }
public void Draw(UndoParentNode owner) { bool value = EditorVariablesManager.ExpandedRenderingOptions.Value; NodeUtils.DrawPropertyGroup(ref value, RenderingOptionsStr, () => { int codeGenCount = m_codeGenerationDataList.Count; // Starting from index 4 because other options are already contemplated with m_renderPath and add/receive shadows for (int i = 4; i < codeGenCount; i++) { m_codeGenerationDataList[i].IsActive = owner.EditorGUILayoutToggleLeft(m_codeGenerationDataList[i].Name, m_codeGenerationDataList[i].IsActive); } }); EditorVariablesManager.ExpandedRenderingOptions.Value = value; }
public void Draw(UndoParentNode owner) { bool visible = EditorVariablesManager.ExpandedVertexOptions.Value; bool enabled = m_isBillboard; NodeUtils.DrawPropertyGroup(owner, ref visible, ref m_isBillboard, BillboardTitleStr, () => { m_billboardType = ( BillboardType )EditorGUILayout.EnumPopup(BillboardTypeStr, m_billboardType); }); EditorVariablesManager.ExpandedVertexOptions.Value = visible; if (m_isBillboard != enabled) { UIUtils.RequestSave(); } }
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; }
public void FloatField(ref UndoParentNode owner, string content) { if (!m_active) { EditorGUILayout.BeginHorizontal(); m_value = owner.EditorGUILayoutFloatField(content, m_value); 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 EnumTypePopup(ref UndoParentNode owner, string content, string[] displayOptions) { if (!m_active) { EditorGUILayout.BeginHorizontal(); m_value = owner.EditorGUILayoutPopup(content, (int)m_value, displayOptions); 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 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); } }