SetMaterialKeywords() private static method

private static SetMaterialKeywords ( Material material, WorkflowMode workflowMode ) : void
material UnityEngine.Material
workflowMode WorkflowMode
return void
        private static void MaterialChanged(Material material, StandardShaderGUI.WorkflowMode workflowMode)
        {
            if (material.GetFloat("_EmissionScaleUI") < 0f)
            {
                material.SetFloat("_EmissionScaleUI", 0f);
            }
            Color color = StandardShaderGUI.EvalFinalEmissionColor(material);

            material.SetColor("_EmissionColor", color);
            StandardShaderGUI.SetupMaterialWithBlendMode(material, (StandardShaderGUI.BlendMode)material.GetFloat("_Mode"));
            StandardShaderGUI.SetMaterialKeywords(material, workflowMode);
        }
        public override void OnGUI(MaterialEditor materialEditor, MaterialProperty[] props)
        {
            this.FindProperties(props);
            this.m_MaterialEditor = materialEditor;
            Material target = materialEditor.target as Material;

            if (this.m_FirstTimeApply)
            {
                StandardShaderGUI.SetMaterialKeywords(target, this.m_WorkflowMode);
                this.m_FirstTimeApply = false;
            }
            this.ShaderPropertiesGUI(target);
        }
示例#3
0
 private static void MaterialChanged(Material material, StandardShaderGUI.WorkflowMode workflowMode)
 {
     StandardShaderGUI.SetupMaterialWithBlendMode(material, (StandardShaderGUI.BlendMode)material.GetFloat("_Mode"));
     StandardShaderGUI.SetMaterialKeywords(material, workflowMode);
 }