Beispiel #1
0
 private void ChangeMaterial(SongPlayer controller, Material newMat)
 {
     Renderer[] children;
     children = controller.GetComponentsInChildren <Renderer>();
     foreach (Renderer rend in children)
     {
         var mats = new Material[rend.materials.Length];
         for (var j = 0; j < rend.materials.Length; j++)
         {
             mats[j] = newMat;
         }
         rend.materials = mats;
     }
 }