Advertisement
Guest User

Untitled

a guest
Apr 26th, 2017
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.47 KB | None | 0 0
  1. using UnityEngine;
  2.  
  3. public class ObjectGlow : MonoBehaviour
  4. {
  5.     public bool highlighted = false;
  6.     public Color glowColor;
  7.     public Color defaultColor = Color.white;
  8.  
  9.     private void Update()
  10.     {
  11.         if (highlighted)
  12.         {
  13.             this.GetComponent<Renderer>().material.color = glowColor;
  14.         }
  15.         else
  16.         {
  17.             this.GetComponent<Renderer>().material.color = defaultColor;
  18.         }
  19.  
  20.         highlighted = false;
  21.     }
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement