IRCSS

Add Dynamic Material Unity

Nov 18th, 2018
141
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.     public static Material AddDynamicMaterial(GameObject gb, Shader sd)
  2.     {
  3.         Renderer r = gb.GetComponent<Renderer>();
  4.         r.material = new Material(r.material);
  5.         return r.material;
  6.     }
RAW Paste Data