private bool IsToon(Material m) { if (m == null) { return(false); } if (m.shader == Shader.Find("Standard")) { return(false); } return(MatToonFader.IsValidName(m.shader.name)); }
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(); } } }