Unity3D Tutorial: 21 Blinking Materijal

Advertisemen

Unity3D Blinking Materijal











THIS IS Java script: GOOD 4 2D GAMES AND 3D GAMES ! 
----------------------------------------­­­­­­­----------------------------------­-­-­-­-­-­-­------



DIRECT DOWNLOAD HERE


----------------------------------------­­­­­------------------------------------­-­-­-­-­-

THIS IS BACKUP  IN TEXT FORM  TUTORIAL 21
1. Create New java and name it : BlinkingMaterijal

2. Copy & Past this text and save java :
----------------------------------------­­­­­------------------------------------­-­-­-­-­-


//Blinking Material Object//
   
var difMaterial : Material;
var lightMaterial : Material;
var timer : float;
var WaitTime : float = 0.5;
var ResetPoint : float;
   
function Start () {
     
    ResetPoint = WaitTime * 2;
     
    }
       
function Update () {
     
    timer += Time.deltaTime;
     
    if(timer < WaitTime)
    {
    renderer.material = difMaterial;
    }
     
    if(timer > WaitTime)
    {
    renderer.material = lightMaterial;
    }
     
    if(timer > ResetPoint)
    {
    timer = 0;
    }
     
    }




----------------------------------------­­­­­------------------------------------­-­-­-­-­-












Advertisemen

Disclaimer: Gambar, artikel ataupun video yang ada di web ini terkadang berasal dari berbagai sumber media lain. Hak Cipta sepenuhnya dipegang oleh sumber tersebut. Jika ada masalah terkait hal ini, Anda dapat menghubungi kami disini.

Tidak ada komentar:

Posting Komentar

© Copyright 2017 Tutorial Unity 3D