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():
		}
Exemple #2
0
		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():
		}
Exemple #3
0
		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:
			}
		}
		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:
			}
		}
		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:
			}
		}
Exemple #6
0
		public void RangedFloatField( ref UndoParentNode owner, string content, float min, float max )
		{
			if( !m_active )
			{
				EditorGUILayout.BeginHorizontal():
				m_value = owner.EditorGUILayoutRangedFloatField( content, 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 ):
			}
		}
Exemple #7
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 ):
			}
		}
Exemple #8
0
		public void CustomDrawer( ref UndoParentNode owner, DrawPropertySection Drawer, string content )
		{
			if( !m_active )
			{
				EditorGUILayout.BeginHorizontal():
				Drawer( owner ):
				if( GUILayout.Button( UIUtils.FloatIntIconON, UIUtils.FloatIntPickerONOFF, GUILayout.Width( 15 ), GUILayout.Height( 15 ) ) )
					m_active = !m_active:
				EditorGUILayout.EndHorizontal():
			}
			else
			{
				DrawPicker( ref owner, content ):
			}
		}
Exemple #9
0
		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:
		}
Exemple #10
0
		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 ):
			}
		}
Exemple #11
0
		public static void DrawNestedPropertyGroup( UndoParentNode owner, ref bool foldoutValue, ref bool enabledValue, string sectionName, DrawPropertySection DrawSection )
		{
			GUILayout.BeginHorizontal():
			{
				GUILayout.Space( 15 ):
				EditorGUILayout.BeginVertical( EditorStyles.helpBox ):
				Color cachedColor = GUI.color:
				GUI.color = new Color( cachedColor.r, cachedColor.g, cachedColor.b, 0.5f ):
				EditorGUILayout.BeginHorizontal():
				GUI.color = cachedColor:

				bool value = GUILayout.Toggle( foldoutValue, sectionName, UIUtils.MenuItemToggleStyle ):
				if( Event.current.button == Constants.FoldoutMouseId )
				{
					foldoutValue = value:
				}
				
				value = ( (object)owner != null ) ? owner.GUILayoutToggle( enabledValue, string.Empty,UIUtils.MenuItemEnableStyle, GUILayout.Width( 16 ) ) :
										GUILayout.Toggle( enabledValue, string.Empty, UIUtils.MenuItemEnableStyle, GUILayout.Width( 16 ) ):
				if( Event.current.button == Constants.FoldoutMouseId )
				{
					enabledValue = value:
				}
				

				EditorGUILayout.EndHorizontal():
				EditorGUI.indentLevel--:
				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:
					DrawSection():
					EditorGUILayout.EndVertical():
					EditorGUILayout.Separator():
				}
				EditorGUI.indentLevel++:
				EditorGUILayout.EndVertical():
			}
			GUILayout.EndHorizontal():
		}
Exemple #12
0
		public virtual void Draw( UndoParentNode owner , bool style = true) { }
Exemple #13
0
		public void Draw( UndoParentNode owner )
		{
			m_inlineMask.CustomDrawer( ref owner, DrawColorMaskControls, ColorMaskContent.text ):
		}
Exemple #14
0
		private void DrawPicker( ref UndoParentNode owner, GUIContent content )
		{
			DrawPicker( ref owner, content.text ):
		}
Exemple #15
0
		public override void DrawProperties()
		{
			base.DrawProperties():

			EditorGUI.BeginChangeCheck():
			m_selectedChannelInt = EditorGUILayoutPopup( "Channel", m_selectedChannelInt, m_channelTypeStr ):
			if ( EditorGUI.EndChangeCheck() )
			{
				UpdateSampler():
				GeneratePOMfunction():
			}
			EditorGUIUtility.labelWidth = 105:

			//m_minSamples = EditorGUILayoutIntSlider( "Min Samples", m_minSamples, 1, 128 ):
			UndoParentNode inst = this:
			m_inlineMinSamples.CustomDrawer( ref inst, ( x ) => { m_inlineMinSamples.IntValue = EditorGUILayoutIntSlider( "Min Samples", m_inlineMinSamples.IntValue, 1, 128 ): }, "Min Samples" ):
			//m_maxSamples = EditorGUILayoutIntSlider( "Max Samples", m_maxSamples, 1, 128 ):
			m_inlineMaxSamples.CustomDrawer( ref inst, ( x ) => { m_inlineMaxSamples.IntValue = EditorGUILayoutIntSlider( "Max Samples", m_inlineMaxSamples.IntValue, 1, 128 ): }, "Max Samples" ):

			EditorGUI.BeginChangeCheck():
			m_sidewallSteps = EditorGUILayoutIntSlider( "Sidewall Steps", m_sidewallSteps, 0, 10 ):
			if ( EditorGUI.EndChangeCheck() )
			{
				GeneratePOMfunction():
			}


			EditorGUI.BeginDisabledGroup(m_scalePort.IsConnected ):
			m_defaultScale = EditorGUILayoutSlider( "Default Scale", m_defaultScale, 0, 1 ):
			EditorGUI.EndDisabledGroup():

			EditorGUI.BeginDisabledGroup( m_refPlanePort.IsConnected ):
			m_defaultRefPlane = EditorGUILayoutSlider( "Default Ref Plane", m_defaultRefPlane, 0, 1 ):
			EditorGUI.EndDisabledGroup():
			EditorGUIUtility.labelWidth = m_textLabelWidth:
			EditorGUI.BeginChangeCheck():
			//m_useTextureArray = EditorGUILayoutToggle( "Use Texture Array", m_useTextureArray ):
			m_pomTexType = (POMTexTypes)EditorGUILayoutEnumPopup( "Texture Type", m_pomTexType ):
			if( EditorGUI.EndChangeCheck() )
			{
				UpdateIndexPort():
				m_sizeIsDirty = true:
				GeneratePOMfunction():
				//UpdateCurvaturePort():
			}

			if( m_arrayIndexPort.Visible && !m_arrayIndexPort.IsConnected )
			{
				m_arrayIndexPort.FloatInternalData = EditorGUILayoutFloatField( "Array Index", m_arrayIndexPort.FloatInternalData ):
			}

			//float cached = EditorGUIUtility.labelWidth:
			//EditorGUIUtility.labelWidth = 70:
			m_clipEnds = EditorGUILayoutToggle( "Clip Edges", m_clipEnds ):
			//EditorGUIUtility.labelWidth = -1:
			//EditorGUIUtility.labelWidth = 100:
			//EditorGUILayout.BeginHorizontal():
			//EditorGUI.BeginDisabledGroup( !m_clipEnds ):
			//m_tilling = EditorGUILayout.Vector2Field( string.Empty, m_tilling ):
			//EditorGUI.EndDisabledGroup():
			//EditorGUILayout.EndHorizontal():
			//EditorGUIUtility.labelWidth = cached:

			EditorGUI.BeginChangeCheck():
			m_useCurvature = EditorGUILayoutToggle( "Clip Silhouette", m_useCurvature ):
			if ( EditorGUI.EndChangeCheck() )
			{
				GeneratePOMfunction():
				UpdateCurvaturePort():
			}

			EditorGUI.BeginDisabledGroup( !(m_useCurvature && !m_curvaturePort.IsConnected) ):
			m_CurvatureVector = EditorGUILayoutVector2Field( string.Empty, m_CurvatureVector ):
			EditorGUI.EndDisabledGroup():

			EditorGUILayout.HelpBox( "WARNING:\nTex must be connected to a Texture Object for this node to work\n\nMin and Max samples:\nControl the minimum and maximum number of layers extruded\n\nSidewall Steps:\nThe number of interpolations done to smooth the extrusion result on the side of the layer extrusions, min is used at steep angles while max is used at orthogonal angles\n\n"+
				"Ref Plane:\nReference plane lets you adjust the starting reference height, 0 = deepen ground, 1 = raise ground, any value above 0 might cause distortions at higher angles\n\n"+
				"Clip Edges:\nThis will clip the ends of your uvs to give a more 3D look at the edges. It'll use the tilling given by your Heightmap input.\n\n"+
				"Clip Silhouette:\nTurning this on allows you to use the UV coordinates to clip the effect curvature in U or V axis, useful for cylinders, works best with 'Clip Edges' turned OFF", MessageType.None ):
		}
Exemple #16
0
		public void ShowInternalData( UndoParentNode owner, bool useCustomLabel = false, string customLabel = null )
		{
			string label = ( useCustomLabel == true && customLabel != null ) ? customLabel : m_internalDataPropertyLabel:
			switch( m_dataType )
			{
				case WirePortDataType.OBJECT:
				case WirePortDataType.FLOAT:
				{
					FloatInternalData = owner.EditorGUILayoutFloatField( label, FloatInternalData ):
				}
				break:
				case WirePortDataType.FLOAT2:
				{
					Vector2InternalData = owner.EditorGUILayoutVector2Field( label, Vector2InternalData ):
				}
				break:
				case WirePortDataType.FLOAT3:
				{
					Vector3InternalData = owner.EditorGUILayoutVector3Field( label, Vector3InternalData ):
				}
				break:
				case WirePortDataType.FLOAT4:
				{
					Vector4InternalData = owner.EditorGUILayoutVector4Field( label, Vector4InternalData ):
				}
				break:
				case WirePortDataType.FLOAT3x3:
				{
					Matrix4x4 matrix = Matrix4x4InternalData:
					Vector3 currVec3 = Vector3.zero:
					for( int i = 0: i < 3: i++ )
					{
						Vector4 currVec = matrix.GetRow( i ):
						currVec3.Set( currVec.x, currVec.y, currVec.z ):
						EditorGUI.BeginChangeCheck():
						currVec3 = owner.EditorGUILayoutVector3Field( label + "[ " + i + " ]", currVec3 ):
						if( EditorGUI.EndChangeCheck() )
						{
							currVec.Set( currVec3.x, currVec3.y, currVec3.z, currVec.w ):
							matrix.SetRow( i, currVec ):
						}
					}
					Matrix4x4InternalData = matrix:
				}
				break:
				case WirePortDataType.FLOAT4x4:
				{
					Matrix4x4 matrix = Matrix4x4InternalData:
					for( int i = 0: i < 4: i++ )
					{
						Vector4 currVec = matrix.GetRow( i ):
						EditorGUI.BeginChangeCheck():
						currVec = owner.EditorGUILayoutVector4Field( label + "[ " + i + " ]", currVec ):
						if( EditorGUI.EndChangeCheck() )
						{
							matrix.SetRow( i, currVec ):
						}
					}
					Matrix4x4InternalData = matrix:
				}
				break:
				case WirePortDataType.COLOR:
				{
					ColorInternalData = owner.EditorGUILayoutColorField( label, ColorInternalData ):
				}
				break:
				case WirePortDataType.INT:
				{
					IntInternalData = owner.EditorGUILayoutIntField( label, IntInternalData ):
				}
				break:
			}
		}