Guest User

Untitled

a guest
Jun 23rd, 2018
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.39 KB | None | 0 0
  1. using UnityEngine;
  2. using System.Collections;
  3.  
  4. public class blink : MonoBehaviour {
  5.  
  6.         bool change = false;
  7.  
  8.     void Start () {
  9.         renderer.material.color = Color.red;
  10.     }
  11.    
  12.     void Update () {
  13.         if (change || Input.GetButtonDown("blink"))
  14.         {
  15.                         change = true;
  16.             renderer.material.color = Color.Lerp(renderer.material.color, Color.black, Time.deltaTime)
  17.         }
  18.     }
  19. }
Add Comment
Please, Sign In to add comment