public override void AssignNewShaderToMaterial(Material material, Shader oldShader, Shader newShader)
    {
        base.AssignNewShaderToMaterial(material, oldShader, newShader);

        if (oldShader == null || !oldShader.name.Contains("Legacy Shaders/"))
        {
            return;
        }

        BlendMode blendingMode = BlendMode.Opaque;

        if (oldShader.name.Contains("/Transparent/Cutout/"))
        {
            blendingMode = BlendMode.AlphaTest;
        }
        else if (oldShader.name.Contains("/Transparent/"))
        {
            blendingMode = BlendMode.AlphaBlend;
        }

        material.SetFloat("_BlendMode", (float)blendingMode);

        LW_MaterialPool.SetMaterialKeywords(material);
    }
    public void ShaderPropertiesGUI(Material material)
    {
        // Use default labelWidth
        EditorGUIUtility.labelWidth = 0f;

        // Detect any changes to the material
        EditorGUI.BeginChangeCheck();

        // Rendering Settings
        EditorGUILayout.Space();
        GUILayout.Label(Styles.renderSettingsText, EditorStyles.boldLabel);
        ModePopup <BlendMode>(blendingMode, Styles.blendingModeText, Styles.blendingNames);
        ModePopup <FeatureMode>(featuresMode, Styles.featuresModeText, Styles.featuresNames);

        // Advanced Settings
        EditorGUILayout.Space();
        GUILayout.Label(Styles.advancedSettingsText, EditorStyles.boldLabel);
        if (((FeatureMode)material.GetFloat("_FeatureMode") == FeatureMode.Advanced))
        {
            ModePopup <StrokeDrawMode>(strokeMode, Styles.strokeModeText, Styles.strokesNames);
            ModePopup <StrokeScaleMode>(scaleStrokesMode, Styles.strokeScaleModeText, Styles.strokeScaleName);
            ModePopup <JoinsAndCapsMode>(joinsCapsMode, Styles.joinsCapsModeText, Styles.joinsCapsNames);
            ModePopup <GradientsMode>(gradientsMode, Styles.gradientsModeText, Styles.gradientsNames);
            ModePopup <AntiAliasingMode>(antiAliasMode, Styles.antiAliasModeText, Styles.antiAliasNames);
            EditorGUILayout.Space();
            m_MaterialEditor.ShaderProperty(albedoColor, Styles.albedoColorText.text);
            m_MaterialEditor.ShaderProperty(widthMultiplier, Styles.widthMultiplierText.text);
        }
        else
        {
            EditorGUILayout.HelpBox(Styles.featuresHelpBoxText.text, MessageType.Info);
        }

        // Primary properties
        EditorGUILayout.Space();
        GUILayout.Label(Styles.primaryMapsText, EditorStyles.boldLabel);
        //m_MaterialEditor.TexturePropertySingleLine(Styles.albedoTextureText, albedoMap, albedoColor);
        m_MaterialEditor.TexturePropertySingleLine(Styles.albedoTextureText, albedoMap);
        m_MaterialEditor.TextureScaleOffsetProperty(albedoMap);

        m_MaterialEditor.TexturePropertySingleLine(Styles.capTextureText, capMap);
        m_MaterialEditor.TextureScaleOffsetProperty(capMap);

        m_MaterialEditor.TexturePropertySingleLine(Styles.joinTextureText, joinMap);
        m_MaterialEditor.TextureScaleOffsetProperty(joinMap);


        if (((BlendMode)material.GetFloat("_BlendMode") == BlendMode.AlphaTest))
        {
            EditorGUILayout.Space();
            GUILayout.Label(Styles.alphaTestText, EditorStyles.boldLabel);
            m_MaterialEditor.ShaderProperty(alphaCutoff, Styles.alphaCutoffText.text);
        }
        else if (((BlendMode)material.GetFloat("_BlendMode") == BlendMode.UI))
        {
            EditorGUILayout.Space();
            GUILayout.Label(Styles.uiText, EditorStyles.boldLabel);
            m_MaterialEditor.ShaderProperty(stencilComp, Styles.stencilCompText.text);
            m_MaterialEditor.ShaderProperty(stencilId, Styles.stencilIdText.text);
            m_MaterialEditor.ShaderProperty(stencilOp, Styles.stencilOpText.text);
            m_MaterialEditor.ShaderProperty(stencilWriteMask, Styles.stencilWriteMaskText.text);
            m_MaterialEditor.ShaderProperty(stencilReadMask, Styles.stencilReadMaskText.text);
            m_MaterialEditor.ShaderProperty(colorMask, Styles.colorMaskText.text);
            m_MaterialEditor.ShaderProperty(useUIAlphaClip, Styles.useUIAlphaClipText.text);
        }

        EditorGUILayout.Space();

        // Secondary properties
        GUILayout.Label(Styles.secondaryMapsText, EditorStyles.boldLabel);
        GUI.enabled = false;
        m_MaterialEditor.TexturePropertySingleLine(Styles.styleDataText, styleDataMap);
        m_MaterialEditor.VectorProperty(styleDataSize, Styles.styleDataSizeText.text);
        GUI.enabled = true;

        bool changed = EditorGUI.EndChangeCheck();

        if (changed)
        {
            foreach (var obj in blendingMode.targets)
            {
                LW_MaterialPool.SetMaterialKeywords((Material)obj);
            }
        }
        else
        {
            EditorGUILayout.Space();

            GUILayout.Label("Debug", EditorStyles.boldLabel);
            EditorGUILayout.LabelField("RenderQueue: " + material.renderQueue);
            EditorGUILayout.LabelField("Keywords: ");
            foreach (string keyWord in material.shaderKeywords)
            {
                EditorGUILayout.LabelField(keyWord);
            }
        }
    }