Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using UnityEngine;
- public class MaterialTest : MonoBehaviour
- {
- private Material _mat;
- void Start()
- {
- _mat = GetComponent<Renderer>().material;
- }
- void Update()
- {
- var col = _mat.color;
- col.r = Mathf.PingPong(Time.time, 1f);
- _mat.color = col;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment