medvedya

EXAMPLE_modify_material

Dec 21st, 2014
479
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

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×