示例#1
0
 private static void ModeChanged(Material[] materials, bool isRenderModeChangedByUser = false)
 {
     foreach (var material in materials)
     {
         UniUnlitUtil.ValidateProperties(material, isRenderModeChangedByUser);
     }
 }
示例#2
0
        public override void AssignNewShaderToMaterial(Material material, Shader oldShader, Shader newShader)
        {
            var blendMode = UniUnlitRenderMode.Opaque;

            if (material.HasProperty(UniUnlitUtil.PropNameStandardShadersRenderMode)) // from Standard shader
            {
                blendMode = (UniUnlitRenderMode)Math.Min(2f, material.GetFloat(UniUnlitUtil.PropNameStandardShadersRenderMode));
            }

            // assigns UniUnlit's properties...
            base.AssignNewShaderToMaterial(material, oldShader, newShader);

            // take over old value
            material.SetFloat(UniUnlitUtil.PropNameBlendMode, (float)blendMode);

            UniUnlitUtil.ValidateProperties(material, isRenderModeChangedByUser: true);
        }