Advertisement
medvedya

EXAMPLE_modify_material

Dec 21st, 2014
636
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.53 KB | None | 0 0
  1. using UnityEngine;
  2. using System.Collections;
  3. using Medvedya.SpriteDeformerTools;
  4.  
  5. public class EXAMPLE_modify_material : MonoBehaviour {
  6.     public Material referenceMaterial;
  7.     public Color color = Color.white;
  8.     Color oldColor;
  9.     void Update () {
  10.         if (oldColor != color)
  11.         {
  12.               oldColor = color;
  13.               foreach (Material mat in BaseOfMaterials.GetAllMaterialsByReferenceMaterial(referenceMaterial))
  14.               {
  15.                   mat.color = color;
  16.               }
  17.          }
  18.     }
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement