public static RendererMaterialSwap Swap(Renderer renderer, Material material, float dur) { if (renderer == null) throw new System.ArgumentNullException("renderer"); if (material == null) throw new System.ArgumentNullException("material"); var swap = renderer.AddOrGetComponent<RendererMaterialSwap>(); swap._renderer = renderer; swap.StartSwap(material, dur); return swap; }