예제 #1
0
        private bool IsToon(Material m)
        {
            if (m == null)
            {
                return(false);
            }
            if (m.shader == Shader.Find("Standard"))
            {
                return(false);
            }

            return(MatToonFader.IsValidName(m.shader.name));
        }
예제 #2
0
        public RendererFader(Renderer renderer, MonoBehaviour owner)
        {
            this.renderer = renderer;
            this.owner    = owner;

            originalMaterials = renderer.sharedMaterials;
            matFaders         = new AbsMatFader[originalMaterials.Length];

            for (int i = 0; i < matFaders.Length; i++)
            {
                Material m = renderer.materials[i];
                matFaders[i] = new MatFader();

                if (IsToon(m))
                {
                    matFaders[i] = new MatToonFader();
                }
            }
        }