daily pastebin goal
42%
SHARE
TWEET

EXAMPLE_modify_material

medvedya Dec 21st, 2014 (edited) 381 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top