Unity3D Tutorial Fade Light

Advertisemen

Unity3D Tutorial Fade Light

Easter video series !









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

DIRECT DOWNLOAD HERE




THIS IS BACKUP  IN TEXT FORM  TUTORIAL FadeLight

1. Create New java and name it : FadeLight


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


#pragma strict
#pragma implicit
#pragma downcast

class FadeLight extends MonoBehaviour
{
public var delay : float;
public var fadeTime : float;
private var fadeSpeed : float;
private var intensity : float;
private var color : Color;
function Start()
{
if(light == null)
{
Destroy(this);
return;
}
intensity = light.intensity;
fadeTime = Mathf.Abs(fadeTime);
if(fadeTime > 0.0)
{
fadeSpeed = intensity / fadeTime;
}
else
{
fadeSpeed = intensity;
}
//alpha = 1.0;
}
function Update()
{
if(delay > 0.0)
{
delay -= Time.deltaTime;
}
else if(intensity > 0.0)
{
intensity -= fadeSpeed * Time.deltaTime;
light.intensity = intensity;
}
}
}







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

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