using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEditor;

namespace Valkyrie
{
    public class OutlineShaderGUI : BasicShaderGUI
    {
        private static class Styles
        {
            public static string shaderText = "[----------Outline----------]";        
            public static GUIContent outlineLabel = EditorGUIUtility.TrTextContent("Outline Thickness","勾边厚度"); //_Outline
            
        }

        MaterialProperty outline = null;

        public new void FindProperties(MaterialProperty[] props)
        {
            outline = FindProperty("_Outline", props);
        }

        public new void ShaderPropertiesGUI(Material material)
        {
            EditorGUI.BeginChangeCheck();
            {
                GUILayout.Label(Styles.shaderText, EditorStyles.boldLabel);
                m_MaterialEditor.ShaderProperty(outline, Styles.outlineLabel);

                EditorGUILayout.Space();
                
            }
            if (EditorGUI.EndChangeCheck())
            {
                
            }
        }

        public override void OnGUI(MaterialEditor materialEditor, MaterialProperty[] props)
        {
            base.FindProperties(props);
            FindProperties(props);
            m_MaterialEditor = materialEditor;
            Material material = materialEditor.target as Material;
            base.ShaderPropertiesGUI(material);
            ShaderPropertiesGUI(material);
            m_MaterialEditor.RenderQueueField();
            m_MaterialEditor.EnableInstancingField();
        }
    }
}
