コード例 #1
0
        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();
        }
コード例 #2
0
        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;
            }
        }
コード例 #3
0
		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:
			}
		}