示例#1
0
        private static void loadTransparencyData()
        {
            ConfigNode[]          nodes = GameDatabase.Instance.GetConfigNodes("TRANSPARENT_SHADER");
            TransparentShaderData tsd;
            int len = nodes.Length;

            for (int i = 0; i < len; i++)
            {
                tsd = new TransparentShaderData(nodes[i]);
                transparentShaderData.Add(tsd.shader.name, tsd);
            }
        }
示例#2
0
        /// <summary>
        /// Return true/false if the input material uses a shader that supports transparency
        /// AND transparency is currently enabled on the material from keywords (if applicable).
        /// </summary>
        /// <param name="mat"></param>
        /// <returns></returns>
        public static bool isTransparentMaterial(Material mat)
        {
            TransparentShaderData tsd = null;

            if (transparentShaderData.TryGetValue(mat.shader.name, out tsd))
            {
                return(tsd.isTransparencyEnabled(mat));
            }
            else
            {
                return(false);
            }
        }
示例#3
0
        public static bool isTransparentShader(string name)
        {
            TransparentShaderData tsd = null;

            if (transparentShaderData.TryGetValue(name, out tsd))
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }