Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- [ExecuteInEditMode]
- public class Colorize : MonoBehaviour {
- public Color color;
- void Start()
- {
- #if UNITY_EDITOR
- this.GetComponent<Renderer>().material.SetColor("_Color", color);
- #endif
- }
- void Update()
- {
- #if UNITY_EDITOR
- this.GetComponent<Renderer>().sharedMaterial.SetColor("_Color", color);
- #endif
- }
- }
RAW Paste Data