private void SetMaskKeywords(Mask_Type mask) { for (int i = 0; i < targets.Length; i++) { Material mat = targets[i] as Material; switch (mask) { case Mask_Type.MaskHard: mat.EnableKeyword("MASK_HARD"); mat.DisableKeyword("MASK_SOFT"); mat.DisableKeyword("MASK_OFF"); break; case Mask_Type.MaskSoft: mat.EnableKeyword("MASK_SOFT"); mat.DisableKeyword("MASK_HARD"); mat.DisableKeyword("MASK_OFF"); break; case Mask_Type.MaskOff: mat.EnableKeyword("MASK_OFF"); mat.DisableKeyword("MASK_HARD"); mat.DisableKeyword("MASK_SOFT"); break; } } }
public string Addtype(string name, string description, int admin) { var ty = (from p in db.Mask_Types where p.Name.Equals(name) select p).FirstOrDefault(); var a = GetAdmin(admin); a.User_Id = admin; if (ty == null) { var newtype = new Mask_Type { Name = name, Description = description, }; db.Mask_Types.InsertOnSubmit(newtype); try { db.SubmitChanges(); return("added"); } catch (Exception ex) { ex.GetBaseException(); return("not added"); } } else { return("error"); } }
private void SetMaskKeywords(Mask_Type mask) { for (int i = 0; i < targets.Length; i++) { Material mat = targets[i] as Material; switch (mask) { case Mask_Type.MaskHard: mat.EnableKeyword("MASK_HARD"); mat.DisableKeyword("MASK_SOFT"); mat.DisableKeyword("MASK_OFF"); //if (m_textMeshPro != null) // m_textMeshPro.maskType = MaskingTypes.MaskHard; //else if (m_textMeshProUGUI != null) //m_textMeshProUGUI.maskType = MaskingTypes.MaskHard; break; case Mask_Type.MaskSoft: mat.EnableKeyword("MASK_SOFT"); mat.DisableKeyword("MASK_HARD"); mat.DisableKeyword("MASK_OFF"); //if (m_textMeshPro != null) // m_textMeshPro.maskType = MaskingTypes.MaskSoft; //else if (m_textMeshProUGUI != null) // m_textMeshProUGUI.maskType = MaskingTypes.MaskSoft; break; case Mask_Type.MaskOff: mat.EnableKeyword("MASK_OFF"); mat.DisableKeyword("MASK_HARD"); mat.DisableKeyword("MASK_SOFT"); //if (m_textMeshPro != null) // m_textMeshPro.maskType = MaskingTypes.MaskOff; //else if (m_textMeshProUGUI != null) // m_textMeshProUGUI.maskType = MaskingTypes.MaskOff; break; } } }
public List <Product> GetProductsByMask_Type(string Name) { List <Product> Products = new List <Product>(); Mask_Type cat = (from n in db.Mask_Types where n.Name.Equals(Name) select n).FirstOrDefault(); int MaskID = cat.Mask_Id; dynamic dbProducts = (from p in db.Products where p.Mask_Id.Equals(MaskID) && p.Active.Equals(1) select p).ToList(); foreach (Product pro in dbProducts) { Products.Add(pro); } return(Products); }
public override void OnInspectorGUI() { // if we are not visible... return //if (!isVisible) // return; ReadMaterialProperties(); Material targetMaterial = target as Material; // If multiple materials have been selected and are not using the same shader, we simply return. if (targets.Length > 1) { for (int i = 0; i < targets.Length; i++) { Material mat = targets[i] as Material; if (targetMaterial.shader != mat.shader) { return; } } } // Retrieve Shader Multi_Compile Keywords m_Keywords = targetMaterial.shaderKeywords; isBevelEnabled = m_Keywords.Contains("BEVEL_ON"); isGlowEnabled = m_Keywords.Contains("GLOW_ON"); //isUnderlayEnabled = m_Keywords.Contains("UNDERLAY_ON") | m_Keywords.Contains("UNDERLAY_INNER"); isRatiosEnabled = !m_Keywords.Contains("RATIOS_OFF"); if (m_Keywords.Contains("UNDERLAY_ON")) { isUnderlayEnabled = true; m_underlaySelection = Underlay_Types.Normal; } else if (m_Keywords.Contains("UNDERLAY_INNER")) { isUnderlayEnabled = true; m_underlaySelection = Underlay_Types.Inner; } else { isUnderlayEnabled = false; } if (m_Keywords.Contains("MASK_HARD")) { m_mask = Mask_Type.MaskHard; } else if (m_Keywords.Contains("MASK_SOFT")) { m_mask = Mask_Type.MaskSoft; } else { m_mask = Mask_Type.MaskOff; } if (m_shaderFlags.hasMixedValue) { m_bevelSelection = 2; } else { m_bevelSelection = (int)m_shaderFlags.floatValue & 1; } // Define the Drag-n-Drop Region (Start) m_inspectorStartRegion = GUILayoutUtility.GetRect(0f, 0f, GUILayout.ExpandWidth(true)); // Check if Shader selection is compatible with Font Asset // TODO EditorGUIUtility.LookLikeControls(130, 50); // FACE PANEL EditorGUI.indentLevel = 0; if (GUILayout.Button("<b>Face</b> - <i>Settings</i> -", Group_Label)) { m_foldout.face = !m_foldout.face; } if (m_foldout.face) { EditorGUI.BeginChangeCheck(); EditorGUI.indentLevel = 1; ColorProperty(m_faceColor, "Color"); if (targetMaterial.HasProperty("_FaceTex")) { DrawTextureProperty(m_faceTex, "Texture"); DrawUVProperty(new MaterialProperty[] { m_faceUVSpeedX, m_faceUVSpeedY }, "UV Speed"); } DrawSliderProperty(m_outlineSoftness, "Softness"); DrawSliderProperty(m_faceDilate, "Dilate"); if (targetMaterial.HasProperty("_FaceShininess")) { DrawSliderProperty(m_faceShininess, "Gloss"); } if (EditorGUI.EndChangeCheck()) { havePropertiesChanged = true; } } // OUTLINE PANEL EditorGUI.indentLevel = 0; if (GUILayout.Button("<b>Outline</b> - <i>Settings</i> -", Group_Label)) { m_foldout.outline = !m_foldout.outline; } if (m_foldout.outline) { EditorGUI.BeginChangeCheck(); EditorGUI.indentLevel = 1; ColorProperty(m_outlineColor, "Color"); if (targetMaterial.HasProperty("_OutlineTex")) { DrawTextureProperty(m_outlineTex, "Texture"); DrawUVProperty(new MaterialProperty[] { m_outlineUVSpeedX, m_outlineUVSpeedY }, "UV Speed"); } DrawSliderProperty(m_outlineThickness, "Thickness"); if (targetMaterial.HasProperty("_OutlineShininess")) { DrawSliderProperty(m_outlineShininess, "Gloss"); } if (EditorGUI.EndChangeCheck()) { havePropertiesChanged = true; } } // UNDERLAY PANEL if (targetMaterial.HasProperty("_UnderlayColor")) { string underlayKeyword = m_underlaySelection == Underlay_Types.Normal ? "UNDERLAY_ON" : "UNDERLAY_INNER"; isUnderlayEnabled = DrawTogglePanel(FoldoutType.underlay, "<b>Underlay</b> - <i>Settings</i> -", isUnderlayEnabled, underlayKeyword); if (m_foldout.underlay) { EditorGUI.BeginChangeCheck(); EditorGUI.indentLevel = 1; m_underlaySelection = (Underlay_Types)EditorGUILayout.EnumPopup("Underlay Type", m_underlaySelection); if (GUI.changed) { SetUnderlayKeywords(); } ColorProperty(m_underlayColor, "Color"); DrawSliderProperty(m_underlayOffsetX, "OffsetX"); DrawSliderProperty(m_underlayOffsetY, "OffsetY"); DrawSliderProperty(m_underlayDilate, "Dilate"); DrawSliderProperty(m_underlaySoftness, "Softness"); if (EditorGUI.EndChangeCheck()) { havePropertiesChanged = true; } } } // BEVEL PANEL if (targetMaterial.HasProperty("_Bevel")) { isBevelEnabled = DrawTogglePanel(FoldoutType.bevel, "<b>Bevel</b> - <i>Settings</i> -", isBevelEnabled, "BEVEL_ON"); if (m_foldout.bevel) { EditorGUI.indentLevel = 1; GUI.changed = false; m_bevelSelection = EditorGUILayout.Popup("Type", m_bevelSelection, m_bevelOptions) & 1; if (GUI.changed) { havePropertiesChanged = true; m_shaderFlags.floatValue = m_bevelSelection; } EditorGUI.BeginChangeCheck(); DrawSliderProperty(m_bevel, "Amount"); DrawSliderProperty(m_bevelOffset, "Offset"); DrawSliderProperty(m_bevelWidth, "Width"); DrawSliderProperty(m_bevelRoundness, "Roundness"); DrawSliderProperty(m_bevelClamp, "Clamp"); if (EditorGUI.EndChangeCheck()) { havePropertiesChanged = true; } } } // LIGHTING PANEL if (targetMaterial.HasProperty("_SpecularColor") || targetMaterial.HasProperty("_SpecColor")) { isBevelEnabled = DrawTogglePanel(FoldoutType.light, "<b>Lighting</b> - <i>Settings</i> -", isBevelEnabled, "BEVEL_ON"); if (m_foldout.light) { EditorGUI.BeginChangeCheck(); EditorGUI.indentLevel = 1; if (targetMaterial.HasProperty("_LightAngle")) { // Non Surface Shader DrawSliderProperty(m_lightAngle, "Light Angle"); ColorProperty(m_specularColor, "Specular Color"); DrawSliderProperty(m_specularPower, "Specular Power"); DrawSliderProperty(m_reflectivity, "Reflectivity Power"); DrawSliderProperty(m_diffuse, "Diffuse Shadow"); DrawSliderProperty(m_ambientLight, "Ambient Shadow"); } else { ColorProperty(m_specColor, "Specular Color"); } if (EditorGUI.EndChangeCheck()) { havePropertiesChanged = true; } } } // BUMPMAP PANEL if (targetMaterial.HasProperty("_BumpMap")) { isBevelEnabled = DrawTogglePanel(FoldoutType.bump, "<b>BumpMap</b> - <i>Settings</i> -", isBevelEnabled, "BEVEL_ON"); if (m_foldout.bump) { EditorGUI.BeginChangeCheck(); DrawTextureProperty(m_bumpMap, "Texture"); DrawSliderProperty(m_bumpFace, "Face"); DrawSliderProperty(m_bumpOutline, "Outline"); if (EditorGUI.EndChangeCheck()) { havePropertiesChanged = true; } } } // ENVMAP PANEL if (targetMaterial.HasProperty("_Cube")) { isBevelEnabled = DrawTogglePanel(FoldoutType.env, "<b>EnvMap</b> - <i>Settings</i> -", isBevelEnabled, "BEVEL_ON"); if (m_foldout.env) { EditorGUI.BeginChangeCheck(); EditorGUI.indentLevel = 1; ColorProperty(m_reflectFaceColor, "Face Color"); ColorProperty(m_reflectOutlineColor, "Outline Color"); DrawTextureProperty(m_reflectTex, "Texture"); if (targetMaterial.HasProperty("_Cube")) { DrawVectorProperty(m_reflectRotation, "EnvMap Rotation"); //var matrix = targetMaterial.GetMatrix("_EnvMatrix"); } if (EditorGUI.EndChangeCheck()) { //var m = Matrix4x4.TRS(Vector3.zero, Quaternion.Euler(m_matrixRotation), new Vector3(1f, 1f, 1f)); //targetMaterial.SetMatrix("_EnvMatrix", m); havePropertiesChanged = true; } } } // GLOW PANEL if (targetMaterial.HasProperty("_GlowColor")) { isGlowEnabled = DrawTogglePanel(FoldoutType.glow, "<b>Glow</b> - <i>Settings</i> -", isGlowEnabled, "GLOW_ON"); if (m_foldout.glow) { EditorGUI.BeginChangeCheck(); EditorGUI.indentLevel = 1; ColorProperty(m_glowColor, "Color"); DrawSliderProperty(m_glowOffset, "Offset"); DrawSliderProperty(m_glowInner, "Inner"); DrawSliderProperty(m_glowOuter, "Outer"); DrawSliderProperty(m_glowPower, "Power"); if (EditorGUI.EndChangeCheck()) { havePropertiesChanged = true; } } } // DEBUG PANEL if (targetMaterial.HasProperty("_GradientScale")) { EditorGUI.indentLevel = 0; if (GUILayout.Button("<b>Debug</b> - <i>Settings</i> -", Group_Label)) { m_foldout.debug = !m_foldout.debug; } if (m_foldout.debug) { EditorGUI.indentLevel = 1; EditorGUI.BeginChangeCheck(); DrawTextureProperty(m_mainTex, "Font Atlas"); DrawFloatProperty(m_gradientScale, "Gradient Scale"); DrawFloatProperty(m_texSampleWidth, "Texture Width"); DrawFloatProperty(m_texSampleHeight, "Texture Height"); GUILayout.Space(20); DrawSliderProperty(m_scaleX, "Scale X"); DrawSliderProperty(m_scaleY, "Scale Y"); DrawSliderProperty(m_PerspectiveFilter, "Perspective Filter"); GUILayout.Space(20); DrawFloatProperty(m_vertexOffsetX, "Offset X"); DrawFloatProperty(m_vertexOffsetY, "Offset Y"); if (EditorGUI.EndChangeCheck()) { havePropertiesChanged = true; } // Mask if (targetMaterial.HasProperty("_MaskCoord")) { GUILayout.Space(15); m_mask = (Mask_Type)EditorGUILayout.EnumPopup("Mask", m_mask); if (GUI.changed) { havePropertiesChanged = true; SetMaskKeywords(m_mask); } if (m_mask != Mask_Type.MaskOff) { EditorGUI.BeginChangeCheck(); Draw2DBoundsProperty(m_maskCoord, "Mask Bounds"); DrawFloatProperty(m_maskSoftnessX, "Softness X"); DrawFloatProperty(m_maskSoftnessY, "Softness Y"); if (EditorGUI.EndChangeCheck()) { havePropertiesChanged = true; } } GUILayout.Space(15); } GUILayout.Space(20); // Stencil if (targetMaterial.HasProperty("_Stencil")) { FloatProperty(m_stencilID, "Stencil ID"); FloatProperty(m_stencilComp, "Stencil Comp"); FloatProperty(m_stencilOp, "Stencil Op"); } GUILayout.Space(20); // Ratios GUI.changed = false; isRatiosEnabled = EditorGUILayout.Toggle("Enable Ratios?", isRatiosEnabled); if (GUI.changed) { SetKeyword(!isRatiosEnabled, "RATIOS_OFF"); } EditorGUI.BeginChangeCheck(); DrawFloatProperty(m_scaleRatio_A, "Scale Ratio A"); DrawFloatProperty(m_scaleRatio_B, "Scale Ratio B"); DrawFloatProperty(m_scaleRatio_C, "Scale Ratio C"); if (EditorGUI.EndChangeCheck()) { havePropertiesChanged = true; } } } // Define the Drag-n-Drop Region (End) m_inspectorEndRegion = GUILayoutUtility.GetRect(0f, 0f, GUILayout.ExpandWidth(true)); DragAndDropGUI(); if (havePropertiesChanged) { //Debug.Log("Material Editor properties have changed. Target is " + target.name); havePropertiesChanged = false; PropertiesChanged(); EditorUtility.SetDirty(target); //TMPro_EditorUtility.RepaintAll(); // Look into using SetDirty. TMPro_EventManager.ON_MATERIAL_PROPERTY_CHANGED(true, target as Material); } }
public override void OnInspectorGUI() { // if we are not visible... return //if (!isVisible) // return; ReadMaterialProperties(); Material targetMaterial = target as Material; // If multiple materials have been selected and are not using the same shader, we simply return. if (targets.Length > 1) { for (int i = 0; i < targets.Length; i++) { Material mat = targets[i] as Material; if (targetMaterial.shader != mat.shader) { return; } } } // Retrieve Shader Multi_Compile Keywords m_Keywords = targetMaterial.shaderKeywords; isBevelEnabled = m_Keywords.Contains("BEVEL_ON"); isGlowEnabled = m_Keywords.Contains("GLOW_ON"); //isUnderlayEnabled = m_Keywords.Contains("UNDERLAY_ON") | m_Keywords.Contains("UNDERLAY_INNER"); isRatiosEnabled = !m_Keywords.Contains("RATIOS_OFF"); if (m_Keywords.Contains("UNDERLAY_ON")) { isUnderlayEnabled = true; m_underlaySelection = Underlay_Types.Normal; } else if (m_Keywords.Contains("UNDERLAY_INNER")) { isUnderlayEnabled = true; m_underlaySelection = Underlay_Types.Inner; } else isUnderlayEnabled = false; if (m_Keywords.Contains("MASK_HARD")) m_mask = Mask_Type.MaskHard; else if (m_Keywords.Contains("MASK_SOFT")) m_mask = Mask_Type.MaskSoft; else m_mask = Mask_Type.MaskOff; if (m_shaderFlags.hasMixedValue) m_bevelSelection = 2; else m_bevelSelection = (int)m_shaderFlags.floatValue & 1; // Define the Drag-n-Drop Region (Start) m_inspectorStartRegion = GUILayoutUtility.GetRect(0f, 0f, GUILayout.ExpandWidth(true)); // Check if Shader selection is compatible with Font Asset // TODO EditorGUIUtility.LookLikeControls(130, 50); // FACE PANEL EditorGUI.indentLevel = 0; if (GUILayout.Button("<b>Face</b> - <i>Settings</i> -", Group_Label)) m_foldout.face = !m_foldout.face; if (m_foldout.face) { EditorGUI.BeginChangeCheck(); EditorGUI.indentLevel = 1; ColorProperty(m_faceColor, "Color"); if (targetMaterial.HasProperty("_FaceTex")) { DrawTextureProperty(m_faceTex, "Texture"); DrawUVProperty(new MaterialProperty[] { m_faceUVSpeedX, m_faceUVSpeedY }, "UV Speed"); } DrawSliderProperty(m_outlineSoftness, "Softness"); DrawSliderProperty(m_faceDilate, "Dilate"); if (targetMaterial.HasProperty("_FaceShininess")) DrawSliderProperty(m_faceShininess, "Gloss"); if (EditorGUI.EndChangeCheck()) havePropertiesChanged = true; } // OUTLINE PANEL EditorGUI.indentLevel = 0; if (GUILayout.Button("<b>Outline</b> - <i>Settings</i> -", Group_Label)) m_foldout.outline = !m_foldout.outline; if (m_foldout.outline) { EditorGUI.BeginChangeCheck(); EditorGUI.indentLevel = 1; ColorProperty(m_outlineColor, "Color"); if (targetMaterial.HasProperty("_OutlineTex")) { DrawTextureProperty(m_outlineTex, "Texture"); DrawUVProperty(new MaterialProperty[] { m_outlineUVSpeedX, m_outlineUVSpeedY }, "UV Speed"); } DrawSliderProperty(m_outlineThickness, "Thickness"); if (targetMaterial.HasProperty("_OutlineShininess")) DrawSliderProperty(m_outlineShininess, "Gloss"); if (EditorGUI.EndChangeCheck()) havePropertiesChanged = true; } // UNDERLAY PANEL if (targetMaterial.HasProperty("_UnderlayColor")) { string underlayKeyword = m_underlaySelection == Underlay_Types.Normal ? "UNDERLAY_ON" : "UNDERLAY_INNER"; isUnderlayEnabled = DrawTogglePanel(FoldoutType.underlay, "<b>Underlay</b> - <i>Settings</i> -", isUnderlayEnabled, underlayKeyword); if (m_foldout.underlay) { EditorGUI.BeginChangeCheck(); EditorGUI.indentLevel = 1; m_underlaySelection = (Underlay_Types)EditorGUILayout.EnumPopup("Underlay Type", m_underlaySelection); if (GUI.changed) SetUnderlayKeywords(); ColorProperty(m_underlayColor, "Color"); DrawSliderProperty(m_underlayOffsetX, "OffsetX"); DrawSliderProperty(m_underlayOffsetY, "OffsetY"); DrawSliderProperty(m_underlayDilate, "Dilate"); DrawSliderProperty(m_underlaySoftness, "Softness"); if (EditorGUI.EndChangeCheck()) havePropertiesChanged = true; } } // BEVEL PANEL if (targetMaterial.HasProperty("_Bevel")) { isBevelEnabled = DrawTogglePanel(FoldoutType.bevel, "<b>Bevel</b> - <i>Settings</i> -", isBevelEnabled, "BEVEL_ON"); if (m_foldout.bevel) { EditorGUI.indentLevel = 1; GUI.changed = false; m_bevelSelection = EditorGUILayout.Popup("Type", m_bevelSelection, m_bevelOptions) & 1; if (GUI.changed) { havePropertiesChanged = true; m_shaderFlags.floatValue = m_bevelSelection; } EditorGUI.BeginChangeCheck(); DrawSliderProperty(m_bevel, "Amount"); DrawSliderProperty(m_bevelOffset, "Offset"); DrawSliderProperty(m_bevelWidth, "Width"); DrawSliderProperty(m_bevelRoundness, "Roundness"); DrawSliderProperty(m_bevelClamp, "Clamp"); if (EditorGUI.EndChangeCheck()) havePropertiesChanged = true; } } // LIGHTING PANEL if (targetMaterial.HasProperty("_SpecularColor") || targetMaterial.HasProperty("_SpecColor")) { isBevelEnabled = DrawTogglePanel(FoldoutType.light, "<b>Lighting</b> - <i>Settings</i> -", isBevelEnabled, "BEVEL_ON"); if (m_foldout.light) { EditorGUI.BeginChangeCheck(); EditorGUI.indentLevel = 1; if (targetMaterial.HasProperty("_LightAngle")) { // Non Surface Shader DrawSliderProperty(m_lightAngle, "Light Angle"); ColorProperty(m_specularColor, "Specular Color"); DrawSliderProperty(m_specularPower, "Specular Power"); DrawSliderProperty(m_reflectivity, "Reflectivity Power"); DrawSliderProperty(m_diffuse, "Diffuse Shadow"); DrawSliderProperty(m_ambientLight, "Ambient Shadow"); } else ColorProperty(m_specColor, "Specular Color"); if (EditorGUI.EndChangeCheck()) havePropertiesChanged = true; } } // BUMPMAP PANEL if (targetMaterial.HasProperty("_BumpMap")) { isBevelEnabled = DrawTogglePanel(FoldoutType.bump, "<b>BumpMap</b> - <i>Settings</i> -", isBevelEnabled, "BEVEL_ON"); if (m_foldout.bump) { EditorGUI.BeginChangeCheck(); DrawTextureProperty(m_bumpMap, "Texture"); DrawSliderProperty(m_bumpFace, "Face"); DrawSliderProperty(m_bumpOutline, "Outline"); if (EditorGUI.EndChangeCheck()) havePropertiesChanged = true; } } // ENVMAP PANEL if (targetMaterial.HasProperty("_Cube")) { isBevelEnabled = DrawTogglePanel(FoldoutType.env, "<b>EnvMap</b> - <i>Settings</i> -", isBevelEnabled, "BEVEL_ON"); if (m_foldout.env) { EditorGUI.BeginChangeCheck(); EditorGUI.indentLevel = 1; ColorProperty(m_reflectFaceColor, "Face Color"); ColorProperty(m_reflectOutlineColor, "Outline Color"); DrawTextureProperty(m_reflectTex, "Texture"); if (targetMaterial.HasProperty("_Cube")) { DrawVectorProperty(m_reflectRotation, "EnvMap Rotation"); //var matrix = targetMaterial.GetMatrix("_EnvMatrix"); } if (EditorGUI.EndChangeCheck()) { //var m = Matrix4x4.TRS(Vector3.zero, Quaternion.Euler(m_matrixRotation), new Vector3(1f, 1f, 1f)); //targetMaterial.SetMatrix("_EnvMatrix", m); havePropertiesChanged = true; } } } // GLOW PANEL if (targetMaterial.HasProperty("_GlowColor")) { isGlowEnabled = DrawTogglePanel(FoldoutType.glow, "<b>Glow</b> - <i>Settings</i> -", isGlowEnabled, "GLOW_ON"); if (m_foldout.glow) { EditorGUI.BeginChangeCheck(); EditorGUI.indentLevel = 1; ColorProperty(m_glowColor, "Color"); DrawSliderProperty(m_glowOffset, "Offset"); DrawSliderProperty(m_glowInner, "Inner"); DrawSliderProperty(m_glowOuter, "Outer"); DrawSliderProperty(m_glowPower, "Power"); if (EditorGUI.EndChangeCheck()) havePropertiesChanged = true; } } // DEBUG PANEL if (targetMaterial.HasProperty("_GradientScale")) { EditorGUI.indentLevel = 0; if (GUILayout.Button("<b>Debug</b> - <i>Settings</i> -", Group_Label)) m_foldout.debug = !m_foldout.debug; if (m_foldout.debug) { EditorGUI.indentLevel = 1; EditorGUI.BeginChangeCheck(); DrawTextureProperty(m_mainTex, "Font Atlas"); DrawFloatProperty(m_gradientScale, "Gradient Scale"); DrawFloatProperty(m_texSampleWidth, "Texture Width"); DrawFloatProperty(m_texSampleHeight, "Texture Height"); GUILayout.Space(20); DrawSliderProperty(m_scaleX, "Scale X"); DrawSliderProperty(m_scaleY, "Scale Y"); DrawSliderProperty(m_PerspectiveFilter, "Perspective Filter"); GUILayout.Space(20); DrawFloatProperty(m_vertexOffsetX, "Offset X"); DrawFloatProperty(m_vertexOffsetY, "Offset Y"); if (EditorGUI.EndChangeCheck()) havePropertiesChanged = true; // Mask if (targetMaterial.HasProperty("_MaskCoord")) { GUILayout.Space(15); m_mask = (Mask_Type)EditorGUILayout.EnumPopup("Mask", m_mask); if (GUI.changed) { havePropertiesChanged = true; SetMaskKeywords(m_mask); } if (m_mask != Mask_Type.MaskOff) { EditorGUI.BeginChangeCheck(); Draw2DBoundsProperty(m_maskCoord, "Mask Bounds"); DrawFloatProperty(m_maskSoftnessX, "Softness X"); DrawFloatProperty(m_maskSoftnessY, "Softness Y"); if (EditorGUI.EndChangeCheck()) havePropertiesChanged = true; } GUILayout.Space(15); } GUILayout.Space(20); // Stencil if (targetMaterial.HasProperty("_Stencil")) { FloatProperty(m_stencilID, "Stencil ID"); FloatProperty(m_stencilComp, "Stencil Comp"); FloatProperty(m_stencilOp, "Stencil Op"); } GUILayout.Space(20); // Ratios GUI.changed = false; isRatiosEnabled = EditorGUILayout.Toggle("Enable Ratios?", isRatiosEnabled); if (GUI.changed) { SetKeyword(!isRatiosEnabled, "RATIOS_OFF"); } EditorGUI.BeginChangeCheck(); DrawFloatProperty(m_scaleRatio_A, "Scale Ratio A"); DrawFloatProperty(m_scaleRatio_B, "Scale Ratio B"); DrawFloatProperty(m_scaleRatio_C, "Scale Ratio C"); if (EditorGUI.EndChangeCheck()) havePropertiesChanged = true; } } // Define the Drag-n-Drop Region (End) m_inspectorEndRegion = GUILayoutUtility.GetRect(0f, 0f, GUILayout.ExpandWidth(true)); DragAndDropGUI(); if (havePropertiesChanged) { //Debug.Log("Material Editor properties have changed. Target is " + target.name); havePropertiesChanged = false; PropertiesChanged(); EditorUtility.SetDirty(target); //TMPro_EditorUtility.RepaintAll(); // Look into using SetDirty. TMPro_EventManager.ON_MATERIAL_PROPERTY_CHANGED(true, target as Material); } }