Unity3D Tutorial Fade Out Camera

Advertisemen

Unity3D Tutorial Fade Out Camera


Easter video series !









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

DIRECT DOWNLOAD HERE




THIS IS BACKUP  IN TEXT FORM  TUTORIAL FadeOutCamera

1. Create New java and name it : FadeOutCamera


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



var fadeTime : float = 5;
var fadeTexture : Texture;
private var fadeOut : boolean = false;
private var tempTime : float;
private var time : float = 0.0;
var fadeOutSound : AudioClip;

function Start(){
fadeOut = true;
audio.clip = fadeOutSound;
audio.Play();
}


function Update(){
if (fadeOut){
if(time < fadeTime) time += Time.deltaTime;
tempTime = Mathf.InverseLerp(0.0, fadeTime, time);
}

if(tempTime >= 1.0) enabled = false;
}

function OnGUI(){
if(fadeOut){
GUI.color.a = 1 - tempTime;
GUI.DrawTexture(Rect(0, 0, Screen.width, Screen.height), fadeTexture);
}
}







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



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