コード例 #1
0
        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);
        }
コード例 #2
0
        private void DoEmissionArea(Material material)
        {
            bool flag  = this.emissionScaleUI.floatValue > 0f;
            bool flag2 = this.emissionMap.textureValue != null;

            this.m_MaterialEditor.TexturePropertySingleLine(StandardShaderGUI.Styles.emissionText, this.emissionMap, (!flag) ? null : this.emissionColorUI, this.emissionScaleUI);
            if (this.emissionMap.textureValue != null && !flag2 && this.emissionScaleUI.floatValue <= 0f)
            {
                this.emissionScaleUI.floatValue = 1f;
            }
            if (flag)
            {
                bool flag3 = StandardShaderGUI.ShouldEmissionBeEnabled(StandardShaderGUI.EvalFinalEmissionColor(material));
                EditorGUI.BeginDisabledGroup(!flag3);
                this.m_MaterialEditor.LightmapEmissionProperty(3);
                EditorGUI.EndDisabledGroup();
            }
            if (!this.HasValidEmissiveKeyword(material))
            {
                EditorGUILayout.HelpBox(StandardShaderGUI.Styles.emissiveWarning.text, MessageType.Warning);
            }
        }