public override void OnGUI(MaterialEditor me, MaterialProperty[] props)
    {
        Material mat = (Material)me.target;

        if (!foldouts.ContainsKey(mat))
        {
            foldouts.Add(mat, toggles);
        }

        foreach (var property in GetType().GetFields(bindingFlags))
        {
            if (property.FieldType == typeof(MaterialProperty))
            {
                property.SetValue(this, FindProperty(property.Name, props));
            }
        }
        string[] shaderVersion = mat.shader.name.Split('v');
        ASWStyles.ShurikenHeaderCentered("{  Arc System Works - Outline v" + "<color=#ff0000ff> " + shaderVersion[1] + "</color>" + "<color=#ffffffff>  }</color>");

        EditorGUI.BeginChangeCheck();
        {
            EditorGUIUtility.labelWidth = 300f; // Use default labelWidth
            EditorGUIUtility.fieldWidth = 50f;  // Use default labelWidth

            ASWStyles.PartingLine();
            if (GUILayout.Button("How to properly set up your outlines") == true)
            {
                Application.OpenURL("https://www.youtube.com/watch?v=SYS3XlRmDaA");
                Debug.Log("Opened external url: https://www.youtube.com/watch?v=SYS3XlRmDaA");
            }
            ASWStyles.PartingLine();
            GUILayout.Space(4);

            if (ASWStyles.DoFoldout(foldouts, mat, me, "Thickness Settings"))
            {
                ASWStyles.PropertyGroupLayer(() => {
                    me.ShaderProperty(_OutlineThickness, _OutlineThickness.displayName);
                    me.ShaderProperty(_EnableCameraDistanceMult, _EnableCameraDistanceMult.displayName);
                    me.ShaderProperty(_DepthOffset, _DepthOffset.displayName);
                });
            }
            if (ASWStyles.DoFoldout(foldouts, mat, me, "Color Settings"))
            {
                ASWStyles.PropertyGroupLayer(() => {
                    me.ShaderProperty(_EnableBaseColorMult, _EnableBaseColorMult.displayName);
                    if (_EnableBaseColorMult.floatValue == 1)
                    {
                        me.TexturePropertySingleLine(Styles.baseText, _Base);
                    }
                    else
                    {
                        me.ShaderProperty(_OutlineColor, _OutlineColor.displayName);
                        me.ShaderProperty(_OutlineColorIntensity, _OutlineColorIntensity.displayName);
                    }
                });
            }
        }
    }
 public static void DrawButtons()
 {
     ASWStyles.PartingLine();
     EditorGUILayout.BeginHorizontal();
     GUILayout.FlexibleSpace();
     ASWStyles.checkVersionButton(100, 30);
     ASWStyles.discordButton(70, 30);
     ASWStyles.paypalButton(30, 30);
     GUILayout.FlexibleSpace();
     EditorGUILayout.EndHorizontal();
 }
Exemple #3
0
    public override void OnGUI(MaterialEditor me, MaterialProperty[] props)
    {
        Material mat = (Material)me.target;

        foreach (var property in GetType().GetFields(bindingFlags))
        {
            if (property.FieldType == typeof(MaterialProperty))
            {
                property.SetValue(this, FindProperty(property.Name, props));
            }
        }
        EditorGUI.BeginChangeCheck();
        {
            //Findprops(props);              // Find props
            EditorGUIUtility.labelWidth = 300f;      // Use default labelWidth
            EditorGUIUtility.fieldWidth = 50f;       // Use default labelWidth

            ASWStyles.ShurikenHeaderCentered("Arc System Works Outline");

            if (GUILayout.Button("How to properly set up your outlines") == true)
            {
                Application.OpenURL("https://www.youtube.com/watch?v=SYS3XlRmDaA");
                Debug.Log("Opened external url: https://www.youtube.com/watch?v=SYS3XlRmDaA");
            }

            // Outline props
            GUILayout.Label("Outline Settings", EditorStyles.boldLabel);
            me.ShaderProperty(_WrongVertexColors, "Are your vertex colors correct?");
            me.ShaderProperty(_OutlineThickness, _OutlineThickness.displayName);
            me.ShaderProperty(_EnableCameraDistanceMult, _EnableCameraDistanceMult.displayName);
            me.ShaderProperty(_EnableBaseColorMult, _EnableBaseColorMult.displayName);
            if (_EnableBaseColorMult.floatValue == 1)
            {
                me.TexturePropertySingleLine(Styles.baseText, _Base);
            }
            else
            {
                me.ShaderProperty(_OutlineColor, _OutlineColor.displayName);
            }
            me.ShaderProperty(_OutlineColorIntensity, _OutlineColorIntensity.displayName);
        }
    }
Exemple #4
0
    public override void OnGUI(MaterialEditor me, MaterialProperty[] props)
    {
        Material mat = (Material)me.target;


        foreach (var property in GetType().GetFields(bindingFlags))
        {
            if (property.FieldType == typeof(MaterialProperty))
            {
                property.SetValue(this, FindProperty(property.Name, props));
            }
        }
        string[] shaderVersion = mat.shader.name.Split('v');
        ASWStyles.ShurikenHeaderCentered("{  Arc System Works - Decal v" + "<color=#ff0000ff> " + shaderVersion[1] + "</color><color=#000000ff>" + "  }</color>");
        EditorGUI.BeginChangeCheck();
        {
            me.ShaderProperty(_Enable, _Enable.displayName);
            me.TexturePropertySingleLine(Styles.mainTex, _MainTex);
            me.ShaderProperty(_DiscolorationModifier, _DiscolorationModifier.displayName);
        }
    }
Exemple #5
0
    public override void OnGUI(MaterialEditor me, MaterialProperty[] props)
    {
        Material mat = (Material)me.target;

        foreach (var property in GetType().GetFields(bindingFlags))
        {
            if (property.FieldType == typeof(MaterialProperty))
            {
                property.SetValue(this, FindProperty(property.Name, props));
            }
        }

        if (!foldouts.ContainsKey(mat))
        {
            foldouts.Add(mat, toggles);
        }

        DirectoryInfo dir = new DirectoryInfo(dirPath);

        FileInfo[] info = dir.GetFiles();
        foreach (FileInfo f in info)
        {
            if (!f.Name.Contains(".meta") && f.Name.Contains(".mat"))
            {
                Material candidate = (Material)AssetDatabase.LoadAssetAtPath(dirPath + f.Name, typeof(Material));
                if (candidate.shader.name == mat.shader.name)
                {
                    int indOf = f.Name.IndexOf(".");
                    presetsList.Add(f.Name.Substring(0, indOf));
                }
            }
        }
        presets = presetsList.ToArray();

        //Findprops(props);              // Find props
        EditorGUIUtility.labelWidth = 300f;  // Use default labelWidth
        EditorGUIUtility.fieldWidth = 50f;   // Use default labelWidth

        string[] shaderVersion = mat.shader.name.Split('v');

        EditorGUI.BeginChangeCheck();
        {
            ASWStyles.ShurikenHeaderCentered("{  Arc System Works - Merged Light v" + "<color=#ff0000ff> " + shaderVersion[1] + "</color>" + "<color=#000000ff>  }</color>");
            // Global props
            if (ASWStyles.DoFoldout(foldouts, mat, me, "Global Settings"))
            {
                //me.ShaderProperty(_ForceFakeLight, _ForceFakeLight.displayName);
                me.ShaderProperty(_WrongVertexColors, "Are your vertex colors correct?");
                me.ShaderProperty(_ForceFakeLight, new GUIContent(_ForceFakeLight.displayName, "Overrides the system that checks if there is a light source in the scene/world."));
                me.ShaderProperty(_FakeLightFallbackDirToggle, new GUIContent(_FakeLightFallbackDirToggle.displayName, "Toggle between different light directions if the scene/world has no light source."));

                if (ASWStyles.DoMediumFoldout(foldouts, mat, me, "Fake Light Settings", Color.yellow))
                {
                    me.ShaderProperty(_FakeLightIntensity, _FakeLightIntensity.displayName);
                    me.ShaderProperty(_FakeLightColor, _FakeLightColor.displayName);
                    if (_FakeLightFallbackDirToggle.floatValue == 0)
                    {
                        me.ShaderProperty(_FakeLightDirX, _FakeLightDirX.displayName);
                        me.ShaderProperty(_FakeLightDirY, _FakeLightDirY.displayName);
                    }
                    else
                    {
                        me.ShaderProperty(_ViewDirOffsetX, _ViewDirOffsetX.displayName);
                        me.ShaderProperty(_ViewDirOffsetY, _ViewDirOffsetY.displayName);
                    }
                }
            }
            // Primary props
            if (ASWStyles.DoFoldout(foldouts, mat, me, "Main Textures"))
            {
                me.TexturePropertySingleLine(Styles.baseText, _Base);
                me.TexturePropertySingleLine(Styles.sssText, _SSS);
                me.TexturePropertySingleLine(Styles.ilmText, _ILM);
                me.TexturePropertySingleLine(Styles.detailText, _Detail);

                if (ASWStyles.DoMediumFoldout(foldouts, mat, me, _METALLICGLOSSMAP, "Metal Matcap", Color.cyan))
                {
                    ASWStyles.ToggleGroup(_METALLICGLOSSMAP.floatValue == 0);
                    me.TexturePropertySingleLine(Styles._MetalMatcapText, _MetalMatcap);
                    me.ShaderProperty(_MetalAIntensity, _MetalAIntensity.displayName);
                    me.ShaderProperty(_MetalBIntensity, _MetalBIntensity.displayName);
                    ASWStyles.ToggleGroupEnd();
                }

                if (ASWStyles.DoMediumFoldout(foldouts, mat, me, _FADE, "Glow Mask", Color.cyan))
                {
                    ASWStyles.ToggleGroup(_FADE.floatValue == 0);
                    me.TexturePropertySingleLine(Styles.glowMaskText, _GlowMask);
                    me.ShaderProperty(_GlowMaskTint, _GlowMaskTint.displayName);
                    me.ShaderProperty(_GlowMaskIntensity, _GlowMaskIntensity.displayName);
                    ASWStyles.ToggleGroupEnd();
                }
            }



            //Light Layer Proprties
            if (ASWStyles.DoFoldout(foldouts, mat, me, "Light Settings"))
            {
                me.ShaderProperty(_ShadowBrightness, _ShadowBrightness.displayName);

                ASWStyles.PartingLine();

                me.ShaderProperty(_ShadowLayer1Push, _ShadowLayer1Push.displayName);
                me.ShaderProperty(_ShadowLayer1Gate, _ShadowLayer1Gate.displayName);
                me.ShaderProperty(_ShadowLayer1Fuzziness, _ShadowLayer1Fuzziness.displayName);
                me.ShaderProperty(_ShadowLayer1Intensity, _ShadowLayer1Intensity.displayName);
                me.ShaderProperty(_ILMLayer1, _ILMLayer1.displayName);
                me.ShaderProperty(_VertexLayer1, _VertexLayer1.displayName);

                ASWStyles.PartingLine();

                me.ShaderProperty(_ShadowLayer2Push, _ShadowLayer2Push.displayName);
                me.ShaderProperty(_ShadowLayer2Gate, _ShadowLayer2Gate.displayName);
                me.ShaderProperty(_ShadowLayer2Fuzziness, _ShadowLayer2Fuzziness.displayName);
                me.ShaderProperty(_ShadowLayer2Intensity, _ShadowLayer2Intensity.displayName);
                me.ShaderProperty(_ILMLayer2, _ILMLayer2.displayName);
                me.ShaderProperty(_VertexLayer2, _VertexLayer2.displayName);

                //Specular Settings
                if (ASWStyles.DoMediumFoldout(foldouts, mat, me, "Specular Settings", Color.yellow))
                {
                    me.ShaderProperty(_SpecularIntensity, _SpecularIntensity.displayName);
                    me.ShaderProperty(_SpecularSize, _SpecularSize.displayName);
                    me.ShaderProperty(_SpecularFuzzy, _SpecularFuzzy.displayName);
                }
            }

            if (ASWStyles.DoFoldout(foldouts, mat, me, "Fresnel Settings"))
            {
                //if ( ASWStyles.DoMediumFoldout(foldouts, mat, me, _COLOROVERLAY, "Highlight Fresnel", Color.cyan)){
                me.ShaderProperty(_COLOROVERLAY, "Enable Fresnel");
                ASWStyles.PartingLine();
                ASWStyles.ToggleGroup(_COLOROVERLAY.floatValue == 0);
                me.ShaderProperty(_FresnelSystem, _FresnelSystem.displayName);
                ASWStyles.PartingLine();
                me.ShaderProperty(_HighlightPower, _HighlightPower.displayName);
                me.ShaderProperty(_HighlightIntensity, _HighlightIntensity.displayName);
                me.ShaderProperty(_HighlightScale, _HighlightScale.displayName);
                me.ShaderProperty(_HighlightFreselFuzzy, _HighlightFreselFuzzy.displayName);
                ASWStyles.PartingLine();

                if (_FresnelSystem.floatValue == 1)
                {
                    me.ShaderProperty(_GranblueDarkenScale, _GranblueDarkenScale.displayName);
                    me.ShaderProperty(_GranblueDarkenPower, _GranblueDarkenPower.displayName);
                }
                else
                {
                    me.ShaderProperty(_DarkHighlightMult, _DarkHighlightMult.displayName);
                }
                ASWStyles.ToggleGroupEnd();
            }

            // Outline props
            if (ASWStyles.DoFoldout(foldouts, mat, me, "Outline Settings"))
            {
                ASWStyles.PartingLine();
                EditorGUILayout.BeginHorizontal();
                GUILayout.FlexibleSpace();
                if (GUILayout.Button("DO NOT USE THIS UNLESS YOU ARE SUPER LAZY\nCLICK THIS TO LEARN HOW TO\nPROPERLY SET UP YOUR OUTLINES", GUILayout.Width(400), GUILayout.Height(50)) == true)
                {
                    Application.OpenURL("https://www.youtube.com/watch?v=SYS3XlRmDaA");
                    Debug.Log("Opened external url: https://www.youtube.com/watch?v=SYS3XlRmDaA");
                }
                GUILayout.FlexibleSpace();
                EditorGUILayout.EndHorizontal();
                ASWStyles.PartingLine();
                me.ShaderProperty(_EnableOutline, _EnableOutline.displayName);
                if (_EnableOutline.floatValue == 1)
                {
                    me.ShaderProperty(_OutlineThickness, _OutlineThickness.displayName);
                    me.ShaderProperty(_EnableCameraDistanceMult, _EnableCameraDistanceMult.displayName);
                    me.ShaderProperty(_EnableBaseColorMult, _EnableBaseColorMult.displayName);
                    if (_EnableBaseColorMult.floatValue == 0)
                    {
                        me.ShaderProperty(_OutlineColor, _OutlineColor.displayName);
                    }
                    me.ShaderProperty(_OutlineColorIntensity, _OutlineColorIntensity.displayName);
                }
            }

            if (ASWStyles.DoFoldout(foldouts, mat, me, "Debug"))
            {
                ASWStyles.PartingLine();
                me.ShaderProperty(_ALPHABLEND, "Enable Debug");
                ASWStyles.PartingLine();
                ASWStyles.ToggleGroup(_ALPHABLEND.floatValue == 0);
                if (ASWStyles.DoMediumFoldout(foldouts, mat, me, _COLORADDSUBDIFF, "Vertex Colors", Color.cyan))
                {
                    ASWStyles.ToggleGroup(_COLORADDSUBDIFF.floatValue == 0);
                    me.ShaderProperty(_VertexChannel, _VertexDebugColor.displayName);
                    me.ShaderProperty(_VertexDebugColor, _VertexDebugColor.displayName);
                    ASWStyles.ToggleGroupEnd();
                }
                if (ASWStyles.DoMediumFoldout(foldouts, mat, me, _PIXELSNAP, "ILM Colors", Color.cyan))
                {
                    ASWStyles.ToggleGroup(_PIXELSNAP.floatValue == 0);
                    me.ShaderProperty(_ILMChannel, _ILMChannel.displayName);
                    me.ShaderProperty(_ILMDebugColor, _ILMDebugColor.displayName);
                    ASWStyles.ToggleGroupEnd();
                }
                if (ASWStyles.DoMediumFoldout(foldouts, mat, me, _COLORCOLOR, "Base and SSS Alpha", Color.cyan))
                {
                    ASWStyles.ToggleGroup(_COLORCOLOR.floatValue == 0);
                    me.ShaderProperty(_BaseSSSAlphaSwap, _BaseSSSAlphaSwap.displayName);
                    me.ShaderProperty(_BaseSSSAlphaColor, _BaseSSSAlphaColor.displayName);
                    ASWStyles.ToggleGroupEnd();
                }
                ASWStyles.ToggleGroupEnd();
            }

            if (ASWStyles.DoFoldout(foldouts, mat, me, "PRESETS"))
            {
                GUILayout.Space(4);
                float buttonWidth = EditorGUIUtility.labelWidth - 5.0f;
                if (ASWStyles.SimpleButton("Capture", buttonWidth, 0))
                {
                    presetText = ASWStyles.ReplaceInvalidChars(presetText);
                    string   filePath = dirPath + presetText + ".mat";
                    Material newMat   = new Material(mat);
                    AssetDatabase.CreateAsset(newMat, filePath);
                    AssetDatabase.Refresh();
                }
                GUILayout.Space(-17);
                Rect r = EditorGUILayout.GetControlRect();
                r.x       += EditorGUIUtility.labelWidth;
                r.width    = ASWStyles.GetPropertyWidth();
                presetText = EditorGUI.TextArea(r, presetText);
                if (ASWStyles.SimpleButton("Apply", buttonWidth, 0))
                {
                    string   presetPath  = dirPath + presets[popupIndex] + ".mat";
                    Material selectedMat = (Material)AssetDatabase.LoadAssetAtPath(presetPath, typeof(Material));
                    mat.CopyPropertiesFromMaterial(selectedMat);
                }
                GUILayout.Space(-17);
                r          = EditorGUILayout.GetControlRect();
                r.x       += EditorGUIUtility.labelWidth;
                r.width    = ASWStyles.GetPropertyWidth();
                popupIndex = EditorGUI.Popup(r, popupIndex, presets);
                GUILayout.Label("Presets are stored in:\n\"" + dirPath + "\"", EditorStyles.textArea);
            }

            if (ASWStyles.DoFoldout(foldouts, mat, me, "Credits"))
            {
                GUILayout.Label("»Thanks to Shamwow for the absolute first guide on the absolute first initial version of the shader.\n\n»Thanks to VCD/Velon for his constant riding of me to keep working on my shader\n\n»Thanks to Nars290 for his constant positivity and assistance with testing and debugging\n\n»Dolce Swenos for being a grammar nazi. \n\n»Thanks to Morioh for showing me how to use custom editor styles and letting me use his Shuriken functions. Really helped make the shader UI look a lot better!\n\n»Thanks to Mochie for his presets system. Even if it is jank and hacked together, its still fantastic.\n\n»Thanks to EdwardsVSGaming for taking a VERY old version of my shader, editing it a small ammount, claiming the entire thing as his own without credit to me, and using deceptive comparisons between that shader and mine forcing me to get off my lazy streak and actually work on my shader again. *clap* *clap* Good job.", EditorStyles.textArea);
            }
            ASWStyles.DrawButtons();
        }
    }
Exemple #6
0
    public override void OnGUI(MaterialEditor me, MaterialProperty[] props)
    {
        Material mat = (Material)me.target;

        foreach (var property in GetType().GetFields(bindingFlags))
        {
            if (property.FieldType == typeof(MaterialProperty))
            {
                property.SetValue(this, FindProperty(property.Name, props));
            }
        }

        if (!foldouts.ContainsKey(mat))
        {
            foldouts.Add(mat, toggles);
        }

        DirectoryInfo dir = new DirectoryInfo(dirPath);

        FileInfo[] info = dir.GetFiles();
        foreach (FileInfo f in info)
        {
            if (!f.Name.Contains(".meta") && f.Name.Contains(".mat"))
            {
                Material candidate = (Material)AssetDatabase.LoadAssetAtPath(dirPath + f.Name, typeof(Material));
                if (candidate.shader.name == mat.shader.name)
                {
                    int indOf = f.Name.IndexOf(".");
                    presetsList.Add(f.Name.Substring(0, indOf));
                }
            }
        }
        presets = presetsList.ToArray();

        //Findprops(props);              // Find props
        EditorGUIUtility.labelWidth = 300f; // Use default labelWidth
        EditorGUIUtility.fieldWidth = 50f;  // Use default labelWidth

        string[] shaderVersion = mat.shader.name.Split('/');
        if (shaderVersion[4].Contains("Transparent"))
        {
            isTransparent = true;
        }
        else
        {
            isTransparent = false;
        }


        if (_EditorVersion.floatValue == 1)
        {
            ASWStyles.ShurikenHeaderCentered("{  Arc System Works - Merged Light " + "<color=#aa0000ff> " + shaderVersion[4] + "</color>" + "<color=#ffffffff> - </color><color=#edba00ff> Advanced</color><color=#ffffffff>  }</color>");
        }
        else
        {
            ASWStyles.ShurikenHeaderCentered("{  Arc System Works - Merged Light " + "<color=#aa0000ff> " + shaderVersion[4] + "</color>" + "<color=#ffffffff> - </color><color=#00aaaaff> Basic</color><color=#ffffffff>  }</color>");
        }

        EditorGUI.BeginChangeCheck();
        {
            ASWStyles.PropertyGroup(() => {
                me.ShaderProperty(_EditorVersion, " ");
                GUILayout.Space(-16);
                if (ASWStyles.DoSmallFoldout(foldouts, mat, me, "Editor Version"))
                {
                    ASWStyles.PropertyGroup(() => {
                        if (_EditorVersion.floatValue == 1)
                        {
                            ASWStyles.CenteredText("WARNING!", 10, 0, -5);
                            ASWStyles.CenteredText("Advanced settings can allow you to fine tune settings if a preset is not close enough.", 10, 0, -5);
                            ASWStyles.CenteredText("It is VERY easy to \"break\" these settings and achieve an undesireable look.", 10, 0, -5);
                            ASWStyles.CenteredText("Only use this if you KNOW what you are doing!", 10, 0, 0);
                        }
                        else
                        {
                            ASWStyles.CenteredText("Recommend loading a Preset from below!", 10, 0, 0);
                        }
                    });
                }
            });
            if (isTransparent)
            {
                me.ShaderProperty(_Opacity, _Opacity.displayName);
            }
            if (ASWStyles.DoFoldout(foldouts, mat, me, "PRESETS"))
            {
                GUILayout.Space(4);
                float buttonWidth = EditorGUIUtility.labelWidth - 5.0f;
                if (ASWStyles.SimpleButton("Capture", buttonWidth, 0))
                {
                    presetText = ASWStyles.ReplaceInvalidChars(presetText);
                    string   filePath = dirPath + presetText + ".mat";
                    Material newMat   = new Material(mat);
                    AssetDatabase.CreateAsset(newMat, filePath);
                    AssetDatabase.Refresh();
                }
                GUILayout.Space(-17);
                Rect r = EditorGUILayout.GetControlRect();
                r.x       += EditorGUIUtility.labelWidth;
                r.width    = ASWStyles.GetPropertyWidth();
                presetText = EditorGUI.TextArea(r, presetText);
                if (ASWStyles.SimpleButton("Apply", buttonWidth, 0))
                {
                    string   presetPath  = dirPath + presets[popupIndex] + ".mat";
                    Material selectedMat = (Material)AssetDatabase.LoadAssetAtPath(presetPath, typeof(Material));
                    mat.CopyPropertiesFromMaterial(selectedMat);
                }
                GUILayout.Space(-17);
                r          = EditorGUILayout.GetControlRect();
                r.x       += EditorGUIUtility.labelWidth;
                r.width    = ASWStyles.GetPropertyWidth();
                popupIndex = EditorGUI.Popup(r, popupIndex, presets);
                GUILayout.Label("Presets are stored in:\n\"" + dirPath + "\"", EditorStyles.textArea);
            }

            if (ASWStyles.DoFoldout(foldouts, mat, me, "Texture Settings"))
            {
                ASWStyles.PropertyGroup(() => {
                    me.TexturePropertySingleLine(Styles.baseText, _Base);
                    if (_EditorVersion.floatValue == 1)
                    {
                        GUILayout.Space(-18);
                        me.ShaderProperty(_EnableColorReplacer, "                                         Enable Color Replacer");
                    }
                    me.TexturePropertySingleLine(Styles.sssText, _SSS);
                    me.TexturePropertySingleLine(Styles.olmText, _OLM);
                    me.TexturePropertySingleLine(Styles.ilmText, _ILM);
                    if (_EditorVersion.floatValue == 1)
                    {
                        GUILayout.Space(-18);
                        me.ShaderProperty(_ILMColorSetting, " ");
                    }
                    me.TexturePropertySingleLine(Styles.detailText, _Detail);
                    if (_EditorVersion.floatValue == 1)
                    {
                        GUILayout.Space(-18);
                        me.ShaderProperty(_DetailColorSetting, " ");
                    }
                });

                if (_EnableColorReplacer.floatValue == 1)
                {
                    if (ASWStyles.DoMediumFoldout(foldouts, mat, me, "Color Replacer", Color.cyan))
                    {
                        me.ShaderProperty(_TotalReplacements, _TotalReplacements.displayName);
                        for (int i = 1; i <= _TotalReplacements.floatValue; i++)
                        {
                            switch (i)
                            {
                            case 1:
                                ASWStyles.PropertyGroup(() => {
                                    if (ASWStyles.DoSmallFoldout(foldouts, mat, me, "Color 1"))
                                    {
                                        ASWStyles.PropertyGroupLayer(() => {
                                            me.ShaderProperty(_Source1Color, _Source1Color.displayName);
                                            me.ShaderProperty(_Target1Color, _Target1Color.displayName);
                                            me.ShaderProperty(_SSSHueShift1, _SSSHueShift1.displayName);
                                            me.ShaderProperty(_Source1Fuzziness, _Source1Fuzziness.displayName);
                                        });
                                    }
                                });
                                break;

                            case 2:
                                ASWStyles.PropertyGroup(() => {
                                    if (ASWStyles.DoSmallFoldout(foldouts, mat, me, "Color 2"))
                                    {
                                        ASWStyles.PropertyGroupLayer(() => {
                                            me.ShaderProperty(_Source2Color, _Source2Color.displayName);
                                            me.ShaderProperty(_Target2Color, _Target2Color.displayName);
                                            me.ShaderProperty(_SSSHueShift2, _SSSHueShift2.displayName);
                                            me.ShaderProperty(_Source2Fuzziness, _Source2Fuzziness.displayName);
                                        });
                                    }
                                });
                                break;

                            case 3:
                                ASWStyles.PropertyGroup(() => {
                                    if (ASWStyles.DoSmallFoldout(foldouts, mat, me, "Color 3"))
                                    {
                                        ASWStyles.PropertyGroupLayer(() => {
                                            me.ShaderProperty(_Source3Color, _Source3Color.displayName);
                                            me.ShaderProperty(_Target3Color, _Target3Color.displayName);
                                            me.ShaderProperty(_SSSHueShift3, _SSSHueShift3.displayName);
                                            me.ShaderProperty(_Source3Fuzziness, _Source3Fuzziness.displayName);
                                        });
                                    }
                                });
                                break;

                            case 4:
                                ASWStyles.PropertyGroup(() => {
                                    if (ASWStyles.DoSmallFoldout(foldouts, mat, me, "Color 4"))
                                    {
                                        ASWStyles.PropertyGroupLayer(() => {
                                            me.ShaderProperty(_Source4Color, _Source4Color.displayName);
                                            me.ShaderProperty(_Target4Color, _Target4Color.displayName);
                                            me.ShaderProperty(_SSSHueShift4, _SSSHueShift4.displayName);
                                            me.ShaderProperty(_Source4Fuzziness, _Source4Fuzziness.displayName);
                                        });
                                    }
                                });
                                break;

                            case 5:
                                ASWStyles.PropertyGroup(() => {
                                    if (ASWStyles.DoSmallFoldout(foldouts, mat, me, "Color 5"))
                                    {
                                        ASWStyles.PropertyGroupLayer(() => {
                                            me.ShaderProperty(_Source5Color, _Source5Color.displayName);
                                            me.ShaderProperty(_Target5Color, _Target5Color.displayName);
                                            me.ShaderProperty(_SSSHueShift5, _SSSHueShift5.displayName);
                                            me.ShaderProperty(_Source5Fuzziness, _Source5Fuzziness.displayName);
                                        });
                                    }
                                });
                                break;
                            }
                        }
                    }
                }
                if (_ILMColorSetting.floatValue > 0)
                {
                    if (ASWStyles.DoMediumFoldout(foldouts, mat, me, "ILM Alpha Body Lines", Color.cyan))
                    {
                        ASWStyles.PropertyGroup(() => {
                            me.ShaderProperty(_ILMAlphaColor, _ILMAlphaColor.displayName);
                            me.ShaderProperty(_ILMAlphaLinesEmissionToggle, _ILMAlphaLinesEmissionToggle.displayName);
                            if (_ILMAlphaLinesEmissionToggle.floatValue == 1)
                            {
                                me.ShaderProperty(_ILMAlphaEmissionIntensity, _ILMAlphaEmissionIntensity.displayName);
                            }
                        });
                    }
                }
            }
            if (_DetailColorSetting.floatValue > 0)
            {
                if (ASWStyles.DoMediumFoldout(foldouts, mat, me, "Detail Body Lines", Color.cyan))
                {
                    ASWStyles.PropertyGroup(() => {
                        me.ShaderProperty(_BodyLinesColor, _BodyLinesColor.displayName);
                        //me.ShaderProperty(_BodyLinesEmissionToggle, _BodyLinesEmissionToggle.displayName);
                        //if(_BodyLinesEmissionToggle.floatValue == 1){
                        //  me.ShaderProperty(_BodyLinesEmissionIntensity, _BodyLinesEmissionIntensity.displayName);
                        //}
                    });
                }
            }

            if (ASWStyles.DoFoldout(foldouts, mat, me, "Light Settings"))
            {
                //GUILayout.Space(-16);
                //me.ShaderProperty(_LightDirectionSetting," ");
                if (ASWStyles.DoMediumFoldout(foldouts, mat, me, _LightDirectionSetting, "Light Direction Settings", Color.yellow))
                {
                    ASWStyles.PropertyGroup(() => {
                        me.ShaderProperty(_FallbackLightDirection, _FallbackLightDirection.displayName);
                        ASWStyles.PropertyGroupLayer(() => {
                            if (_FallbackLightDirection.floatValue == 0)
                            {
                                me.ShaderProperty(_FakeLightDirX, _FakeLightDirX.displayName);
                                me.ShaderProperty(_FakeLightDirY, _FakeLightDirY.displayName);
                            }
                            else
                            {
                                me.ShaderProperty(_ViewDirOffsetPitch, _ViewDirOffsetPitch.displayName);
                                me.ShaderProperty(_ViewDirOffsetYaw, _ViewDirOffsetYaw.displayName);
                            }
                        });
                    });
                }
                if (ASWStyles.DoMediumFoldout(foldouts, mat, me, _LightColorSetting, "Light Color Settings", Color.yellow))
                {
                    if (_EditorVersion.floatValue == 1)
                    {
                        ASWStyles.PropertyGroup(() => {
                            me.ShaderProperty(_MinimumGlobalLightIntensity, _MinimumGlobalLightIntensity.displayName);
                        });
                    }
                    ASWStyles.PropertyGroup(() => {
                        me.ShaderProperty(_FakeGlobalLightColor, _FakeGlobalLightColor.displayName);
                        me.ShaderProperty(_FakeGlobalLightIntensity, _FakeGlobalLightIntensity.displayName);
                    });
                    if (_EditorVersion.floatValue == 1)
                    {
                        ASWStyles.PropertyGroup(() => {
                            if (ASWStyles.DoSmallFoldout(foldouts, mat, me, "Game Style Light Tinting"))
                            {
                                ASWStyles.PropertyGroupLayer(() => {
                                    me.ShaderProperty(_LightColor, _LightColor.displayName);
                                    me.ShaderProperty(_AmbientColor, _AmbientColor.displayName);
                                });
                            }
                        });
                    }
                }
            }

            if (ASWStyles.DoFoldout(foldouts, mat, me, "Ramp Settings"))
            {
                ASWStyles.PropertyGroup(() => {
                    me.ShaderProperty(_GlobalLightPush, _GlobalLightPush.displayName);
                });
                if (_EditorVersion.floatValue == 1)
                {
                    ASWStyles.PropertyGroup(() => {
                        me.ShaderProperty(_PermanentShadowThreshold, _PermanentShadowThreshold.displayName);
                    });
                }
                if (ASWStyles.DoMediumFoldout(foldouts, mat, me, "Rimlight", Color.yellow))
                {
                    ASWStyles.PropertyGroup(() => {
                        me.ShaderProperty(_EnableRimlight, _EnableRimlight.displayName);
                        ASWStyles.ToggleGroup(_EnableRimlight.floatValue == 0);
                        me.ShaderProperty(_RimlightSize, _RimlightSize.displayName);
                    });
                    if (_EditorVersion.floatValue == 1)
                    {
                        ASWStyles.PropertyGroup(() => {
                            me.ShaderProperty(_RimlightIntensity, _RimlightIntensity.displayName);
                            me.ShaderProperty(_RimlightTint, _RimlightTint.displayName);
                            me.ShaderProperty(_RimlightSaturation, _RimlightSaturation.displayName);
                            me.ShaderProperty(_RimlightEmissiveToggle, _RimlightEmissiveToggle.displayName);
                            if (_RimlightEmissiveToggle.floatValue == 1)
                            {
                                me.ShaderProperty(_RimlightEmissionIntensity, _RimlightEmissionIntensity.displayName);
                            }
                        });
                    }
                    ASWStyles.ToggleGroupEnd();
                }
                if (ASWStyles.DoMediumFoldout(foldouts, mat, me, "Specular", Color.yellow))
                {
                    ASWStyles.PropertyGroup(() => {
                        me.ShaderProperty(_SpecularSize, _SpecularSize.displayName);
                    });
                    if (_EditorVersion.floatValue == 1)
                    {
                        ASWStyles.PropertyGroup(() => {
                            me.ShaderProperty(_SpecularIntensity, _SpecularIntensity.displayName);
                            me.ShaderProperty(_SpecularTint, _SpecularTint.displayName);
                            me.ShaderProperty(_SpecularSaturation, _SpecularSaturation.displayName);
                            me.ShaderProperty(_SpecularEmissiveToggle, _SpecularEmissiveToggle.displayName);
                            if (_SpecularEmissiveToggle.floatValue == 1)
                            {
                                me.ShaderProperty(_SpecularEmissionIntensity, _SpecularEmissionIntensity.displayName);
                            }
                        });
                    }
                }
                if (_EditorVersion.floatValue == 1)
                {
                    if (ASWStyles.DoMediumFoldout(foldouts, mat, me, "Base", Color.yellow))
                    {
                        ASWStyles.PropertyGroup(() => {
                            me.ShaderProperty(_BaseIntensity, _BaseIntensity.displayName);
                            me.ShaderProperty(_BaseTint, _BaseTint.displayName);
                            me.ShaderProperty(_BaseSaturation, _BaseSaturation.displayName);
                            me.ShaderProperty(_BaseEmissiveToggle, _BaseEmissiveToggle.displayName);
                            if (_BaseEmissiveToggle.floatValue == 1)
                            {
                                me.ShaderProperty(_BaseEmissionIntensity, _BaseEmissionIntensity.displayName);
                            }
                        });
                        ASWStyles.PropertyGroup(() => {
                            me.ShaderProperty(_SSSAlphaEmissiveToggle, _SSSAlphaEmissiveToggle.displayName);
                            if (_SSSAlphaEmissiveToggle.floatValue == 1)
                            {
                                me.ShaderProperty(_SSSAlphaEmissiveIntensity, _SSSAlphaEmissiveIntensity.displayName);
                            }
                        });
                    }
                    if (ASWStyles.DoMediumFoldout(foldouts, mat, me, "Shadow 1", Color.yellow))
                    {
                        ASWStyles.PropertyGroup(() => {
                            me.ShaderProperty(_Shadow1Push, _Shadow1Push.displayName);
                            me.ShaderProperty(_Shadow1Smoothness, _Shadow1Smoothness.displayName);
                            me.ShaderProperty(_Shadow1VertexRThreshold, _Shadow1VertexRThreshold.displayName);
                        });
                        ASWStyles.PropertyGroup(() => {
                            me.ShaderProperty(_Shadow1Intensity, _Shadow1Intensity.displayName);
                            me.ShaderProperty(_Shadow1Tint, _Shadow1Tint.displayName);
                            me.ShaderProperty(_Shadow1Saturation, _Shadow1Saturation.displayName);
                            me.ShaderProperty(_Shadow1EmissiveToggle, _Shadow1EmissiveToggle.displayName);
                            if (_Shadow1EmissiveToggle.floatValue == 1)
                            {
                                me.ShaderProperty(_Shadow1EmissionIntensity, _Shadow1EmissionIntensity.displayName);
                            }
                        });
                    }
                    if (ASWStyles.DoMediumFoldout(foldouts, mat, me, "Shadow 2", Color.yellow))
                    {
                        ASWStyles.PropertyGroup(() => {
                            me.ShaderProperty(_Shadow2Push, _Shadow2Push.displayName);
                            me.ShaderProperty(_Shadow2Smoothness, _Shadow2Smoothness.displayName);
                            me.ShaderProperty(_Shadow2VertexRThreshold, _Shadow2VertexRThreshold.displayName);
                        });
                        ASWStyles.PropertyGroup(() => {
                            me.ShaderProperty(_Shadow2Intensity, _Shadow2Intensity.displayName);
                            me.ShaderProperty(_Shadow2Tint, _Shadow2Tint.displayName);
                            me.ShaderProperty(_Shadow2Saturation, _Shadow2Saturation.displayName);
                            me.ShaderProperty(_Shadow2EmissiveToggle, _Shadow2EmissiveToggle.displayName);
                            if (_Shadow2EmissiveToggle.floatValue == 1)
                            {
                                me.ShaderProperty(_Shadow2EmissionIntensity, _Shadow2EmissionIntensity.displayName);
                            }
                        });
                    }
                }
            }

            if (ASWStyles.DoFoldout(foldouts, mat, me, "Outline"))
            {
                if (isTransparent)
                {
                    EditorGUILayout.BeginHorizontal();
                    GUILayout.FlexibleSpace();
                    if (GUILayout.Button("Outlines are not supported here on Transparent versions\nof the shader. Click here to learn how to\nproperly set up your outlines.", GUILayout.Width(400), GUILayout.Height(50)) == true)
                    {
                        Application.OpenURL("https://www.youtube.com/watch?v=SYS3XlRmDaA");
                        Debug.Log("Opened external url: https://www.youtube.com/watch?v=SYS3XlRmDaA");
                    }
                    GUILayout.FlexibleSpace();
                    EditorGUILayout.EndHorizontal();
                }
                else
                {
                    EditorGUILayout.BeginHorizontal();
                    GUILayout.FlexibleSpace();
                    if (GUILayout.Button("DO NOT USE THIS UNLESS YOU ARE SUPER LAZY\nCLICK THIS TO LEARN HOW TO\nPROPERLY SET UP YOUR OUTLINES", GUILayout.Width(400), GUILayout.Height(50)) == true)
                    {
                        Application.OpenURL("https://www.youtube.com/watch?v=SYS3XlRmDaA");
                        Debug.Log("Opened external url: https://www.youtube.com/watch?v=SYS3XlRmDaA");
                    }
                    GUILayout.FlexibleSpace();
                    EditorGUILayout.EndHorizontal();
                    ASWStyles.PropertyGroup(() => {
                        me.ShaderProperty(_EnableOutline, _EnableOutline.displayName);
                    });
                    if (_EnableOutline.floatValue == 1)
                    {
                        if (ASWStyles.DoMediumFoldout(foldouts, mat, me, "Outline Thickness Settings", Color.cyan))
                        {
                            ASWStyles.PropertyGroup(() => {
                                me.ShaderProperty(_OutlineThickness, _OutlineThickness.displayName);
                                me.ShaderProperty(_EnableCameraDistanceMult, _EnableCameraDistanceMult.displayName);
                                me.ShaderProperty(_DepthOffset, _DepthOffset.displayName);
                            });
                        }
                        if (ASWStyles.DoMediumFoldout(foldouts, mat, me, "Outline Color Settings", Color.cyan))
                        {
                            ASWStyles.PropertyGroup(() => {
                                me.ShaderProperty(_OutlineEnableBaseColorMult, _OutlineEnableBaseColorMult.displayName);
                                if (_OutlineEnableBaseColorMult.floatValue == 0)
                                {
                                    ASWStyles.PropertyGroup(() => {
                                        me.ShaderProperty(_OutlineColor, _OutlineColor.displayName);
                                        me.ShaderProperty(_OutlineColorIntensity, _OutlineColorIntensity.displayName);
                                    });
                                }
                            });
                        }
                    }
                }
            }
            if (_EditorVersion.floatValue == 1)
            {
                if (ASWStyles.DoFoldout(foldouts, mat, me, "Rendering Options"))
                {
                    if (ASWStyles.DoMediumFoldout(foldouts, mat, me, "Stencil Buffer", Color.yellow))
                    {
                        ASWStyles.PropertyGroupLayer(() => {
                            me.ShaderProperty(_Reference, _Reference.displayName);
                            me.ShaderProperty(_ReadMask, _ReadMask.displayName);
                            me.ShaderProperty(_WriteMask, _WriteMask.displayName);
                            me.ShaderProperty(_Comparison, _Comparison.displayName);
                            me.ShaderProperty(_PassFront, _PassFront.displayName);
                            me.ShaderProperty(_FailFront, _FailFront.displayName);
                            me.ShaderProperty(_ZFailFront, _ZFailFront.displayName);
                        });
                    }
                    if (ASWStyles.DoMediumFoldout(foldouts, mat, me, "Depth", Color.yellow))
                    {
                        ASWStyles.PropertyGroupLayer(() => {
                            me.ShaderProperty(_ZWriteMode, _ZWriteMode.displayName);
                            me.ShaderProperty(_ZTestMode, _ZTestMode.displayName);
                            me.ShaderProperty(_Factor, _Factor.displayName);
                            me.ShaderProperty(_Units, _Units.displayName);
                        });
                    }
                }
                if (ASWStyles.DoFoldout(foldouts, mat, me, "Debug"))
                {
                    ASWStyles.PropertyGroup(() => {
                        me.ShaderProperty(_EnableDebug, "Enable Debug");
                        if (_EnableDebug.floatValue == 1)
                        {
                            ASWStyles.PropertyGroupLayer(() => {
                                me.ShaderProperty(_DebugColor, _DebugColor.displayName);
                                me.ShaderProperty(_DebugGroup, _DebugGroup.displayName);
                            });
                            ASWStyles.PropertyGroupLayer(() => {
                                switch (_DebugGroup.floatValue)
                                {
                                case 0:
                                    me.ShaderProperty(_VertexChannel, _VertexChannel.displayName);
                                    switch (_VertexChannel.floatValue)
                                    {
                                    case 1:
                                        explain = "Ambient Occlusion/Tendency to be shaded. The darker this channel is, the more likely that area is to be shaded.";
                                        break;

                                    case 2:
                                        explain = "Scales the outline based on distance to camera. The darker the channel is, the less the camera distance affects the scale.";
                                        break;

                                    case 3:
                                        explain = "Shifts the outline in the camera Z depth. The darker the channel is, the more the outline is shifted away from the camera.";
                                        break;

                                    case 4:
                                        explain = "Base outline thickness. The brighter the channel is, the thicker the outline is before any other effects are applied.";
                                        break;
                                    }
                                    break;

                                case 1:
                                    me.ShaderProperty(_ILMChannel, _ILMChannel.displayName);
                                    switch (_ILMChannel.floatValue)
                                    {
                                    case 1:
                                        explain = "Specular intensity. The brighter the channel, the brighter the specular is.";
                                        break;

                                    case 2:
                                        explain = "Tendency to be shaded. The darker this channel is, the more likely that area is to be shaded.";
                                        break;

                                    case 3:
                                        explain = "Specular Ease. The brighter the channel, the more likely it is to get specular. Black has no specular.";
                                        break;

                                    case 4:
                                        explain = "Body lines. By default this is multiplied directly onto the base texture. ";
                                        break;
                                    }
                                    break;

                                case 2:
                                    me.ShaderProperty(_BaseSSSAlphaSwap, _BaseSSSAlphaSwap.displayName);
                                    switch (_BaseSSSAlphaSwap.floatValue)
                                    {
                                    case 0:
                                        explain = "Rimlight scale. The brighter the channel, the larger the rimlight.";
                                        break;

                                    case 1:
                                        explain = "Currently unknown exact use";
                                        break;
                                    }
                                    break;
                                }
                                GUILayout.Label("Explaination of this channel:\n" + explain, EditorStyles.helpBox);
                            });
                        }
                    });
                }
            }

            if (ASWStyles.DoFoldout(foldouts, mat, me, "Credits"))
            {
                GUILayout.Label("»Thanks to Shamwow for the absolute first guide on the absolute first initial version of the shader.\n\n»Thanks to VCD/Velon for his constant riding of me to keep working on my shader\n\n»Thanks to Nars290 for his constant positivity and assistance with testing and debugging\n\n»Thanks to AreCreeps for information on how the FighterZ Rimlight system works.\n\n»Thanks to Syll for their knowledge on the outline generation.\n\n»Dulce Sueños for being a grammar nazi. \n\n»Thanks to Morioh for showing me how to use custom editor styles. Really helped make the shader UI look a lot better!\n\n»Thanks to Mochie for his foldouts, the toggles that power it, and the presets system. (Even if it is jank and hacked together, its still fantastic!)\n\n»Thanks to ScruffyRuffles for his absolutely HUGE brain and explaining how to solve point lights and light attenuation. No more solar flares near point lights!\n\n»Thanks to ACIIL for his help in understanding the Unity View Matrix to fix the View Direction Offset.\n\n»Big thanks to everyone in the VRC Shader Development Discord for answering general questions and tips on how things work.\n\n»Thanks to EdwardsVSGaming for taking a VERY old version of my shader, editing it a small ammount, claiming the entire thing as his own without credit to me, and using deceptive comparisons between that shader and mine forcing me to get off my lazy streak and actually work on my shader again. *clap* *clap* Good job.", EditorStyles.textArea);
            }
            ASWStyles.PartingLine();
            me.RenderQueueField();
            ASWStyles.DrawButtons();
            ASWStyles.CenteredTexture(gameTex, 0, 0);
        }
    }
Exemple #7
0
    public override void OnGUI(MaterialEditor me, MaterialProperty[] props)
    {
        Material mat = (Material)me.target;

        if (!foldouts.ContainsKey(mat))
        {
            foldouts.Add(mat, toggles);
        }

        foreach (var property in GetType().GetFields(bindingFlags))
        {
            if (property.FieldType == typeof(MaterialProperty))
            {
                property.SetValue(this, FindProperty(property.Name, props));
            }
        }
        string[] shaderVersion = mat.shader.name.Split('v');
        ASWStyles.ShurikenHeaderCentered("{  Arc System Works - Outline v" + "<color=#ff0000ff> " + shaderVersion[1] + "</color>" + "<color=#000000ff>  }</color>");

        EditorGUI.BeginChangeCheck();
        {
            //Findprops(props);              // Find props
            EditorGUIUtility.labelWidth = 300f;      // Use default labelWidth
            EditorGUIUtility.fieldWidth = 50f;       // Use default labelWidth

            if (GUILayout.Button("How to properly set up your outlines") == true)
            {
                Application.OpenURL("https://www.youtube.com/watch?v=SYS3XlRmDaA");
                Debug.Log("Opened external url: https://www.youtube.com/watch?v=SYS3XlRmDaA");
            }

            // Outline props
            GUILayout.Label("Outline Settings", EditorStyles.boldLabel);

            if (ASWStyles.DoFoldout(foldouts, mat, me, "Thickness Settings"))
            {
                me.ShaderProperty(_OutlineThickness, _OutlineThickness.displayName);
                me.ShaderProperty(_EnableCameraDistanceMult, _EnableCameraDistanceMult.displayName);
                if (_EnableCameraDistanceMult.floatValue == 1)
                {
                    me.ShaderProperty(_CameraDistanceMult, _CameraDistanceMult.displayName);
                }
                ASWStyles.PartingLine();
                me.ShaderProperty(_DepthOffset, _DepthOffset.displayName);
                me.ShaderProperty(_DepthCalculation, _DepthCalculation.displayName);
            }
            if (ASWStyles.DoFoldout(foldouts, mat, me, "Color Settings"))
            {
                me.ShaderProperty(_EnableBaseColorMult, _EnableBaseColorMult.displayName);
                if (_EnableBaseColorMult.floatValue == 1)
                {
                    me.TexturePropertySingleLine(Styles.baseText, _Base);
                }
                else
                {
                    me.ShaderProperty(_OutlineColor, _OutlineColor.displayName);
                }
                me.ShaderProperty(_OutlineColorIntensity, _OutlineColorIntensity.displayName);
                ASWStyles.PartingLine();
                me.ShaderProperty(_EnableLightColorMult, _EnableLightColorMult.displayName);
                if (_EnableLightColorMult.floatValue == 1)
                {
                    me.ShaderProperty(_LightColorSetting, new GUIContent(_LightColorSetting.displayName, "Overrides the system that checks if there is a light source in the scene/world."));
                    me.ShaderProperty(_GlobalIntensityMinimum, _GlobalIntensityMinimum.displayName);
                    if (_LightColorSetting.floatValue == 1)
                    {
                        ASWStyles.PartingLine();
                        me.ShaderProperty(_FakeLightColor, _FakeLightColor.displayName);
                        me.ShaderProperty(_FakeLightIntensity, _FakeLightIntensity.displayName);
                    }
                }
            }
        }
    }
Exemple #8
0
    public override void OnGUI(MaterialEditor me, MaterialProperty[] props)
    {
        Material mat = (Material)me.target;

        foreach (var property in GetType().GetFields(bindingFlags))
        {
            if (property.FieldType == typeof(MaterialProperty))
            {
                property.SetValue(this, FindProperty(property.Name, props));
            }
        }

        if (!foldouts.ContainsKey(mat))
        {
            foldouts.Add(mat, toggles);
        }

        DirectoryInfo dir = new DirectoryInfo(dirPath);

        FileInfo[] info = dir.GetFiles();
        foreach (FileInfo f in info)
        {
            if (!f.Name.Contains(".meta") && f.Name.Contains(".mat"))
            {
                Material candidate = (Material)AssetDatabase.LoadAssetAtPath(dirPath + f.Name, typeof(Material));
                if (candidate.shader.name == mat.shader.name)
                {
                    int indOf = f.Name.IndexOf(".");
                    presetsList.Add(f.Name.Substring(0, indOf));
                }
            }
        }
        presets = presetsList.ToArray();

        //Findprops(props);              // Find props
        EditorGUIUtility.labelWidth = 300f; // Use default labelWidth
        EditorGUIUtility.fieldWidth = 50f;  // Use default labelWidth

        string[] shaderVersion = mat.shader.name.Split('v');

        if (_EditorVersion.floatValue == 1)
        {
            ASWStyles.ShurikenHeaderCentered("{  Arc System Works - Merged Light v" + "<color=#aa0000ff> " + shaderVersion[1] + "</color>" + "<color=#000000ff> - </color><color=#edba00ff> Advanced</color><color=#000000ff>  }</color>");
        }
        else
        {
            ASWStyles.ShurikenHeaderCentered("{  Arc System Works - Merged Light v" + "<color=#aa0000ff> " + shaderVersion[1] + "</color>" + "<color=#000000ff> - </color><color=#00aaaaff> Basic</color><color=#000000ff>  }</color>");
        }

        EditorGUI.BeginChangeCheck();
        {
            if (ASWStyles.DoFoldout(foldouts, mat, me, "PRESETS"))
            {
                GUILayout.Space(4);
                float buttonWidth = EditorGUIUtility.labelWidth - 5.0f;
                if (ASWStyles.SimpleButton("Capture", buttonWidth, 0))
                {
                    presetText = ASWStyles.ReplaceInvalidChars(presetText);
                    string   filePath = dirPath + presetText + ".mat";
                    Material newMat   = new Material(mat);
                    AssetDatabase.CreateAsset(newMat, filePath);
                    AssetDatabase.Refresh();
                }
                GUILayout.Space(-17);
                Rect r = EditorGUILayout.GetControlRect();
                r.x       += EditorGUIUtility.labelWidth;
                r.width    = ASWStyles.GetPropertyWidth();
                presetText = EditorGUI.TextArea(r, presetText);
                if (ASWStyles.SimpleButton("Apply", buttonWidth, 0))
                {
                    string   presetPath  = dirPath + presets[popupIndex] + ".mat";
                    Material selectedMat = (Material)AssetDatabase.LoadAssetAtPath(presetPath, typeof(Material));
                    mat.CopyPropertiesFromMaterial(selectedMat);
                }
                GUILayout.Space(-17);
                r          = EditorGUILayout.GetControlRect();
                r.x       += EditorGUIUtility.labelWidth;
                r.width    = ASWStyles.GetPropertyWidth();
                popupIndex = EditorGUI.Popup(r, popupIndex, presets);
                GUILayout.Label("Presets are stored in:\n\"" + dirPath + "\"", EditorStyles.textArea);
            }

            // Global props
            if (ASWStyles.DoFoldout(foldouts, mat, me, "Global Settings"))
            {
                me.ShaderProperty(_EditorVersion, _EditorVersion.displayName);
                GUILayout.BeginHorizontal("box");
                GUILayout.FlexibleSpace();
                if (_EditorVersion.floatValue == 1)
                {
                    GUILayout.Label("                                                                 WARNING!\nAdvanced settings can allow you to fine tune settings if a preset is not close enough.\n                              Only use this if you KNOW what you are doing!", EditorStyles.boldLabel);
                }
                else
                {
                    GUILayout.Label("Recommend loading a Preset from above!");
                }
                GUILayout.FlexibleSpace();
                GUILayout.EndHorizontal();
                ASWStyles.PartingLine();
                GUILayout.Label("Looking for \"Wrong Vertex Colors\"? This setting has been removed as the updated Guilty Gear Blender script solves this issue. Please use the updated script which can be found on my Discord or in the Guilty Gear Script Guide video description.", EditorStyles.textArea);
            }
            // Primary props
            if (ASWStyles.DoFoldout(foldouts, mat, me, "Main Textures"))
            {
                me.TexturePropertySingleLine(Styles.baseText, _Base);
                if (_EditorVersion.floatValue == 1)
                {
                    GUILayout.Space(-18);
                    me.ShaderProperty(_ALPHABLEND, "                                         Enable Color Replacer");
                }
                me.TexturePropertySingleLine(Styles.sssText, _SSS);
                me.TexturePropertySingleLine(Styles.ilmText, _ILM);
                if (_EditorVersion.floatValue == 1)
                {
                    GUILayout.Space(-18);
                    me.ShaderProperty(_ILMColorSetting, " ");
                }
                me.TexturePropertySingleLine(Styles.detailText, _Detail);
                if (_EditorVersion.floatValue == 1)
                {
                    GUILayout.Space(-18);
                    me.ShaderProperty(_DetailColorSetting, " ");
                }

                if (_ALPHABLEND.floatValue == 1)
                {
                    if (ASWStyles.DoMediumFoldout(foldouts, mat, me, "Color Replacer", Color.cyan))
                    {
                        if (_FresnelSystem.floatValue != 0 && _EnableFresnel.floatValue == 1)
                        {
                            GUILayout.Label("WARNING! PLEASE DISABLE FRESNEL WHILE WORKING ON GRANBLUE MODELS!\nTHE FRESNEL CONFLICTS WITH THE COLOR PICKER TOOL!\nENABLE FRESNEL AFTER FINISHED PICKING COLORS!", EditorStyles.textArea);
                        }
                        me.ShaderProperty(_TotalReplacements, _TotalReplacements.displayName);

                        for (int i = 1; i <= _TotalReplacements.floatValue; ++i)
                        {
                            switch (i)
                            {
                            case 1:
                                ASWStyles.PartingLine();
                                me.ShaderProperty(_Source1Color, _Source1Color.displayName);
                                me.ShaderProperty(_Target1Color, _Target1Color.displayName);
                                me.ShaderProperty(_Source1Fuzziness, _Source1Fuzziness.displayName);
                                break;

                            case 2:
                                ASWStyles.PartingLine();
                                me.ShaderProperty(_Source2Color, _Source2Color.displayName);
                                me.ShaderProperty(_Target2Color, _Target2Color.displayName);
                                me.ShaderProperty(_Source2Fuzziness, _Source2Fuzziness.displayName);
                                break;

                            case 3:
                                ASWStyles.PartingLine();
                                me.ShaderProperty(_Source3Color, _Source3Color.displayName);
                                me.ShaderProperty(_Target3Color, _Target3Color.displayName);
                                me.ShaderProperty(_Source3Fuzziness, _Source3Fuzziness.displayName);
                                break;

                            case 4:
                                ASWStyles.PartingLine();
                                me.ShaderProperty(_Source4Color, _Source4Color.displayName);
                                me.ShaderProperty(_Target4Color, _Target4Color.displayName);
                                me.ShaderProperty(_Source4Fuzziness, _Source4Fuzziness.displayName);
                                break;

                            case 5:
                                ASWStyles.PartingLine();
                                me.ShaderProperty(_Source5Color, _Source5Color.displayName);
                                me.ShaderProperty(_Target5Color, _Target5Color.displayName);
                                me.ShaderProperty(_Source5Fuzziness, _Source5Fuzziness.displayName);
                                break;
                            }
                        }
                    }
                }

                if (_ILMColorSetting.floatValue > 0)
                {
                    if (ASWStyles.DoMediumFoldout(foldouts, mat, me, "ILM Body Lines Color", Color.cyan))
                    {
                        me.ShaderProperty(_ILMColor, _ILMColor.displayName);
                        me.ShaderProperty(_EnableILMEmission, "Enable ILM Lines Glow");
                        if (_EnableILMEmission.floatValue == 1)
                        {
                            me.ShaderProperty(_ILMEmissiveIntensity, _ILMEmissiveIntensity.displayName);
                        }
                    }
                }

                if (_DetailColorSetting.floatValue > 0)
                {
                    if (ASWStyles.DoMediumFoldout(foldouts, mat, me, "Detail Lines Color", Color.cyan))
                    {
                        me.ShaderProperty(_DetailColor, _DetailColor.displayName);
                        me.ShaderProperty(_EnableDetailEmission, "Enable Detail Lines Glow");
                        if (_EnableDetailEmission.floatValue == 1)
                        {
                            me.ShaderProperty(_DetailEmissiveIntensity, _DetailEmissiveIntensity.displayName);
                        }
                    }
                }

                if (ASWStyles.DoMediumFoldout(foldouts, mat, me, _EnableMatcap, "Metal Matcap", Color.cyan))
                {
                    ASWStyles.ToggleGroup(_EnableMatcap.floatValue == 0);
                    me.TexturePropertySingleLine(Styles._MetalMatcapText, _MetalMatcap);
                    if (_EditorVersion.floatValue == 1)
                    {
                        me.ShaderProperty(_MetalAIntensity, _MetalAIntensity.displayName);
                        me.ShaderProperty(_MetalBIntensity, _MetalBIntensity.displayName);
                    }
                    ASWStyles.ToggleGroupEnd();
                }
                if (ASWStyles.DoMediumFoldout(foldouts, mat, me, _EnableGlowmask, "Glow Mask", Color.cyan))
                {
                    ASWStyles.ToggleGroup(_EnableGlowmask.floatValue == 0);
                    me.TexturePropertySingleLine(Styles.glowMaskText, _GlowMask);
                    me.ShaderProperty(_GlowMaskIntensity, _GlowMaskIntensity.displayName);
                    if (_EditorVersion.floatValue == 1)
                    {
                        me.ShaderProperty(_GlowMaskMultSystem, _GlowMaskMultSystem.displayName);
                        me.ShaderProperty(_GlowMaskTint, _GlowMaskTint.displayName);
                    }
                    ASWStyles.ToggleGroupEnd();
                }
            }



            //Light Layer Proprties
            if (ASWStyles.DoFoldout(foldouts, mat, me, "Light Settings"))
            {
                me.ShaderProperty(_LightDirectionSetting, new GUIContent(_LightDirectionSetting.displayName, "Overrides the system that checks if there is a light source in the scene/world."));
                me.ShaderProperty(_LightColorSetting, new GUIContent(_LightColorSetting.displayName, "Overrides the system that checks if there is a light source in the scene/world."));

                ASWStyles.PartingLine();
                me.ShaderProperty(_GlobalIntensityMinimum, _GlobalIntensityMinimum.displayName);
                ASWStyles.PartingLine();

                if (ASWStyles.DoMediumFoldout(foldouts, mat, me, "Fake Light Settings", Color.yellow))
                {
                    me.ShaderProperty(_FakeLightFallbackDirection, new GUIContent(_FakeLightFallbackDirection.displayName, "Toggle between different light directions if the scene/world has no light source."));
                    me.ShaderProperty(_FakeLightIntensity, _FakeLightIntensity.displayName);
                    me.ShaderProperty(_FakeLightColor, _FakeLightColor.displayName);
                    if (_EditorVersion.floatValue == 1)
                    {
                        if (_FakeLightFallbackDirection.floatValue == 0)
                        {
                            me.ShaderProperty(_FakeLightDirX, _FakeLightDirX.displayName);
                            me.ShaderProperty(_FakeLightDirY, _FakeLightDirY.displayName);
                        }
                        else
                        {
                            //me.ShaderProperty(_ViewDirOffsetX, _ViewDirOffsetX.displayName);
                            me.ShaderProperty(_ViewDirOffsetY, _ViewDirOffsetY.displayName);
                            //GUILayout.Label("Note: VRChat flips the 'X' direction from what is visible here. Negate any value you put in the X to see what it will look like in game.", EditorStyles.helpBox);
                        }
                    }
                }
                if (ASWStyles.DoMediumFoldout(foldouts, mat, me, "Shadow Settings", Color.yellow))
                {
                    me.ShaderProperty(_ShadowBrightness, _ShadowBrightness.displayName);

                    ASWStyles.PartingLine();

                    me.ShaderProperty(_ShadowLayer1Push, _ShadowLayer1Push.displayName);
                    if (_EditorVersion.floatValue == 1)
                    {
                        me.ShaderProperty(_ShadowLayer1Gate, _ShadowLayer1Gate.displayName);
                        me.ShaderProperty(_ShadowLayer1Fuzziness, _ShadowLayer1Fuzziness.displayName);
                        me.ShaderProperty(_ShadowLayer1Intensity, _ShadowLayer1Intensity.displayName);
                        me.ShaderProperty(_ILMLayer1, _ILMLayer1.displayName);
                        me.ShaderProperty(_VertexLayer1, _VertexLayer1.displayName);
                    }

                    ASWStyles.PartingLine();

                    me.ShaderProperty(_ShadowLayer2Push, _ShadowLayer2Push.displayName);
                    if (_EditorVersion.floatValue == 1)
                    {
                        me.ShaderProperty(_ShadowLayer2Gate, _ShadowLayer2Gate.displayName);
                        me.ShaderProperty(_ShadowLayer2Fuzziness, _ShadowLayer2Fuzziness.displayName);
                        me.ShaderProperty(_ShadowLayer2Intensity, _ShadowLayer2Intensity.displayName);
                        me.ShaderProperty(_ILMLayer2, _ILMLayer2.displayName);
                        me.ShaderProperty(_VertexLayer2, _VertexLayer2.displayName);
                    }
                }

                //Specular Settings
                if (ASWStyles.DoMediumFoldout(foldouts, mat, me, "Specular Settings", Color.yellow))
                {
                    me.ShaderProperty(_SpecularIntensity, _SpecularIntensity.displayName);
                    me.ShaderProperty(_SpecularSize, _SpecularSize.displayName);
                    me.ShaderProperty(_SpecularFuzzy, _SpecularFuzzy.displayName);
                }
            }
            if (ASWStyles.DoFoldout(foldouts, mat, me, "Fresnel Settings"))
            {
                me.ShaderProperty(_EnableFresnel, "Enable Fresnel");
                ASWStyles.PartingLine();
                ASWStyles.ToggleGroup(_EnableFresnel.floatValue == 0);
                me.ShaderProperty(_FresnelSystem, _FresnelSystem.displayName);
                if (_EditorVersion.floatValue == 1)
                {
                    ASWStyles.PartingLine();
                    me.ShaderProperty(_HighlightPower, _HighlightPower.displayName);
                    me.ShaderProperty(_HighlightIntensity, _HighlightIntensity.displayName);
                    me.ShaderProperty(_HighlightScale, _HighlightScale.displayName);
                    me.ShaderProperty(_HighlightFreselFuzzy, _HighlightFreselFuzzy.displayName);
                    ASWStyles.PartingLine();

                    if (_FresnelSystem.floatValue == 1)
                    {
                        me.ShaderProperty(_GranblueDarkenScale, _GranblueDarkenScale.displayName);
                        me.ShaderProperty(_GranblueDarkenPower, _GranblueDarkenPower.displayName);
                    }
                    else
                    {
                        me.ShaderProperty(_DarkHighlightMult, _DarkHighlightMult.displayName);
                    }
                }
                ASWStyles.ToggleGroupEnd();
            }
            // Outline props
            if (ASWStyles.DoFoldout(foldouts, mat, me, "Outline Settings"))
            {
                ASWStyles.PartingLine();
                EditorGUILayout.BeginHorizontal();
                GUILayout.FlexibleSpace();
                // if (GUILayout.Button("Looking for outlines?\nThe built-in outlines have been removed due to incompatablity with the most recent updates.\nPlease click this button to learn how to set up your outlines properly.", GUILayout.Width(550), GUILayout.Height(75)) == true){
                //  Application.OpenURL("https://www.youtube.com/watch?v=SYS3XlRmDaA");
                //     Debug.Log("Opened external url: https://www.youtube.com/watch?v=SYS3XlRmDaA");
                // }
                if (GUILayout.Button("DO NOT USE THIS UNLESS YOU ARE SUPER LAZY\nCLICK THIS TO LEARN HOW TO\nPROPERLY SET UP YOUR OUTLINES", GUILayout.Width(400), GUILayout.Height(50)) == true)
                {
                    Application.OpenURL("https://www.youtube.com/watch?v=SYS3XlRmDaA");
                    Debug.Log("Opened external url: https://www.youtube.com/watch?v=SYS3XlRmDaA");
                }
                GUILayout.FlexibleSpace();
                EditorGUILayout.EndHorizontal();
                ASWStyles.PartingLine();
                me.ShaderProperty(_EnableOutline, _EnableOutline.displayName);
                if (_EnableOutline.floatValue == 1)
                {
                    if (ASWStyles.DoMediumFoldout(foldouts, mat, me, "Thickness", Color.cyan))
                    {
                        me.ShaderProperty(_OutlineThickness, _OutlineThickness.displayName);
                        if (_EditorVersion.floatValue == 1)
                        {
                            me.ShaderProperty(_EnableCameraDistanceMult, _EnableCameraDistanceMult.displayName);
                            if (_EnableCameraDistanceMult.floatValue == 1)
                            {
                                me.ShaderProperty(_CameraDistanceMult, _CameraDistanceMult.displayName);
                            }
                            ASWStyles.PartingLine();
                            me.ShaderProperty(_DepthOffset, _DepthOffset.displayName);
                            me.ShaderProperty(_DepthCalculation, _DepthCalculation.displayName);
                        }
                    }
                    if (_EditorVersion.floatValue == 1)
                    {
                        if (ASWStyles.DoMediumFoldout(foldouts, mat, me, "Color", Color.cyan))
                        {
                            me.ShaderProperty(_EnableLightColorMult, _EnableLightColorMult.displayName);
                            me.ShaderProperty(_EnableBaseColorMult, _EnableBaseColorMult.displayName);
                            if (_EnableBaseColorMult.floatValue == 0)
                            {
                                me.ShaderProperty(_OutlineColor, _OutlineColor.displayName);
                            }
                            me.ShaderProperty(_OutlineColorIntensity, _OutlineColorIntensity.displayName);
                        }
                    }
                }
            }
            if (_EditorVersion.floatValue == 1)
            {
                if (ASWStyles.DoFoldout(foldouts, mat, me, "Debug"))
                {
                    ASWStyles.PartingLine();
                    me.ShaderProperty(_ALPHATEST, "Enable Debug");
                    ASWStyles.PartingLine();
                    if (_ALPHATEST.floatValue == 1)
                    {
                        me.ShaderProperty(_DebugGroup, _DebugGroup.displayName);
                        me.ShaderProperty(_DebugColor, _DebugColor.displayName);
                        ASWStyles.PartingLine();
                        switch (_DebugGroup.floatValue)
                        {
                        case 0:
                            me.ShaderProperty(_VertexChannel, _VertexChannel.displayName);
                            break;

                        case 1:
                            me.ShaderProperty(_ILMChannel, _ILMChannel.displayName);
                            break;

                        case 2:
                            me.ShaderProperty(_BaseSSSAlphaSwap, _BaseSSSAlphaSwap.displayName);
                            break;
                        }
                    }
                }
            }

            if (ASWStyles.DoFoldout(foldouts, mat, me, "Credits"))
            {
                GUILayout.Label("»Thanks to Shamwow for the absolute first guide on the absolute first initial version of the shader.\n\n»Thanks to VCD/Velon for his constant riding of me to keep working on my shader\n\n»Thanks to Nars290 for his constant positivity and assistance with testing and debugging\n\n»Thanks to Syll for their knowledge on the outline generation.\n\n»Dolce Swenos for being a grammar nazi. \n\n»Thanks to Morioh for showing me how to use custom editor styles and letting me use his Shuriken functions. Really helped make the shader UI look a lot better!\n\n»Thanks to Mochie for his presets system. Even if it is jank and hacked together, its still fantastic.\n\n»Thanks to EdwardsVSGaming for taking a VERY old version of my shader, editing it a small ammount, claiming the entire thing as his own without credit to me, and using deceptive comparisons between that shader and mine forcing me to get off my lazy streak and actually work on my shader again. *clap* *clap* Good job.", EditorStyles.textArea);
            }
            ASWStyles.DrawButtons();
        }
    }
    public override void OnGUI(MaterialEditor me, MaterialProperty[] props)
    {
        Material mat = (Material)me.target;

        foreach (var property in GetType().GetFields(bindingFlags))
        {
            if (property.FieldType == typeof(MaterialProperty))
            {
                property.SetValue(this, FindProperty(property.Name, props));
            }
        }

        if (!foldouts.ContainsKey(mat))
        {
            foldouts.Add(mat, toggles);
        }

        //Findprops(props);              // Find props
        EditorGUIUtility.labelWidth = 300f; // Use default labelWidth
        EditorGUIUtility.fieldWidth = 50f;  // Use default labelWidth

        string[] shaderVersion = mat.shader.name.Split('/');
        if (shaderVersion[4].Contains("Transparent"))
        {
            isTransparent = true;
        }
        else
        {
            isTransparent = false;
        }

        ASWStyles.ShurikenHeaderCentered("{  Arc System Works - Metal/Matcap " + "<color=#aa0000ff> " + shaderVersion[4] + "</color>" + "<color=#ffffffff>  }</color>");

        EditorGUI.BeginChangeCheck();
        {
            if (isTransparent)
            {
                me.ShaderProperty(_Opacity, _Opacity.displayName);
            }
            if (ASWStyles.DoFoldout(foldouts, mat, me, "Color Settings"))
            {
                ASWStyles.PropertyGroup(() => {
                    me.TexturePropertySingleLine(Styles.baseText, _Base);
                    me.TexturePropertySingleLine(Styles.metalText, _Metal);
                });
            }

            if (ASWStyles.DoFoldout(foldouts, mat, me, "Light Settings"))
            {
                if (ASWStyles.DoMediumFoldout(foldouts, mat, me, _LightColorSetting, "Light Color Settings", Color.yellow))
                {
                    ASWStyles.PropertyGroup(() => {
                        me.ShaderProperty(_MinimumGlobalLightIntensity, _MinimumGlobalLightIntensity.displayName);
                    });
                    ASWStyles.PropertyGroup(() => {
                        me.ShaderProperty(_FakeGlobalLightColor, _FakeGlobalLightColor.displayName);
                        me.ShaderProperty(_FakeGlobalLightIntensity, _FakeGlobalLightIntensity.displayName);
                    });
                }
            }

            if (ASWStyles.DoFoldout(foldouts, mat, me, "Outline"))
            {
                EditorGUILayout.BeginHorizontal();
                GUILayout.FlexibleSpace();
                if (GUILayout.Button("DO NOT USE THIS UNLESS YOU ARE SUPER LAZY\nCLICK THIS TO LEARN HOW TO\nPROPERLY SET UP YOUR OUTLINES", GUILayout.Width(400), GUILayout.Height(50)) == true)
                {
                    Application.OpenURL("https://www.youtube.com/watch?v=SYS3XlRmDaA");
                    Debug.Log("Opened external url: https://www.youtube.com/watch?v=SYS3XlRmDaA");
                }
                GUILayout.FlexibleSpace();
                EditorGUILayout.EndHorizontal();
                ASWStyles.PropertyGroup(() => {
                    me.ShaderProperty(_EnableOutline, _EnableOutline.displayName);
                });
                if (_EnableOutline.floatValue == 1)
                {
                    if (ASWStyles.DoMediumFoldout(foldouts, mat, me, "Outline Thickness Settings", Color.cyan))
                    {
                        ASWStyles.PropertyGroup(() => {
                            me.ShaderProperty(_OutlineThickness, _OutlineThickness.displayName);
                            me.ShaderProperty(_EnableCameraDistanceMult, _EnableCameraDistanceMult.displayName);
                            me.ShaderProperty(_DepthOffset, _DepthOffset.displayName);
                        });
                    }
                    if (ASWStyles.DoMediumFoldout(foldouts, mat, me, "Outline Color Settings", Color.cyan))
                    {
                        ASWStyles.PropertyGroup(() => {
                            me.ShaderProperty(_OutlineEnableBaseColorMult, _OutlineEnableBaseColorMult.displayName);
                            if (_OutlineEnableBaseColorMult.floatValue == 0)
                            {
                                ASWStyles.PropertyGroup(() => {
                                    me.ShaderProperty(_OutlineColor, _OutlineColor.displayName);
                                    me.ShaderProperty(_OutlineColorIntensity, _OutlineColorIntensity.displayName);
                                });
                            }
                        });
                    }
                }
            }
            if (ASWStyles.DoFoldout(foldouts, mat, me, "Rendering Options"))
            {
                if (ASWStyles.DoMediumFoldout(foldouts, mat, me, "Stencil Buffer", Color.yellow))
                {
                    ASWStyles.PropertyGroupLayer(() => {
                        me.ShaderProperty(_Reference, _Reference.displayName);
                        me.ShaderProperty(_ReadMask, _ReadMask.displayName);
                        me.ShaderProperty(_WriteMask, _WriteMask.displayName);
                        me.ShaderProperty(_Comparison, _Comparison.displayName);
                        me.ShaderProperty(_PassFront, _PassFront.displayName);
                        me.ShaderProperty(_FailFront, _FailFront.displayName);
                        me.ShaderProperty(_ZFailFront, _ZFailFront.displayName);
                    });
                }
                if (ASWStyles.DoMediumFoldout(foldouts, mat, me, "Depth", Color.yellow))
                {
                    ASWStyles.PropertyGroupLayer(() => {
                        me.ShaderProperty(_ZWriteMode, _ZWriteMode.displayName);
                        me.ShaderProperty(_ZTestMode, _ZTestMode.displayName);
                        me.ShaderProperty(_Factor, _Factor.displayName);
                        me.ShaderProperty(_Units, _Units.displayName);
                    });
                }
            }
            ASWStyles.PartingLine();
            me.RenderQueueField();
        }
    }