/// <summary> /// Displays fields fpr all magic light parameters /// </summary> /// <param name="me"></param> /// <param name="isSurfaceShader"></param> protected void ShowMagicLightParams(MaterialEditor me, bool isSurfaceShader) { // Toggle to use magic light MultiMaterialEditorGUI.ShaderPropertyField(me, "_UseMagicLight", "Use Magic Light"); MaterialProperty useMagicLight = MaterialEditor.GetMaterialProperty(me.targets, "_UseMagicLight"); // only show the rest if the magic light is used if (useMagicLight.floatValue > 0) { ++EditorGUI.indentLevel; bool useStencil = MultiMaterialEditorGUI.ToggleLeft(me, "_UseStencil", "Use Stencil"); // display stencil map if stencil is used if (useStencil) { ++EditorGUI.indentLevel; MultiMaterialEditorGUI.TextureField(me, "_StencilMap", new GUIContent("Stencil Map (RGB)", "R -> Cutout, G -> Border 1, B -> Border 2"), true); --EditorGUI.indentLevel; } else // display scale factor and invert option if no stencil is used { MultiMaterialEditorGUI.ToggleLeft(me, "_Inverted", "Inverted"); MultiMaterialEditorGUI.FloatField(me, "_RadiusScaleFactor", "Light Radius Scale Factor"); } ShowAnimationParams(me); ShowBorderOptions(me, useStencil, isSurfaceShader); --EditorGUI.indentLevel; } }
protected void ShowGeneralProperties3(MaterialEditor me) { MultiMaterialEditorGUI.ShaderPropertyField(me, "_FadeBorder", "Fade Border"); MaterialProperty fadeBorder = MaterialEditor.GetMaterialProperty(me.targets, "_FadeBorder"); if (fadeBorder.floatValue > 0) { EditorGUI.indentLevel++; MultiMaterialEditorGUI.FloatField(me, "_BorderGradientHardness", "Border Hardness"); MultiMaterialEditorGUI.TextureField(me, "_NoiseMap", "Dither Pattern", false); MultiMaterialEditorGUI.FloatField(me, "_NoiseScale", "Dither Pattern Scale"); MultiMaterialEditorGUI.Slider(me, "_NoiseThreshold", "Dither Pattern Threshold", 0, 1); EditorGUI.indentLevel--; } }