So I have a script here. I want to know how I can fade out to and time it so that there is a specific time frame between fade in to fade out.
Please…anyone help.
`
//Author: ----------------------------Electric Fountain----------------------------------
//var tex is the texture for the fade
//var aTexture is the texture I am using for the Logo
var tex: Texture;
var aTexture : Texture;
var _timeOfFade:float=0;
var delta:float;
var postion: Rect;
private var _color:Color=Color(1.0f,1.0f,1.0f,1.0f);
function Update () {
delta=(1/_timeOfFade)*Time.deltaTime;
}
function OnGUI() {
if(_color.a>0){
_color.a-=delta;
GUI.color=_color;
GUI.DrawTexture(postion, tex, ScaleMode.ScaleToFit, true, 10.0f);
if(!aTexture){
Debug.LogError(“Assign a Texture in the inspector.”);
return;
}
GUI.DrawTexture(Rect(143,-200,1000,1000), aTexture);
}
}`
Please hit 'edit', select your code, and hit the 101/010 button to format that code
– DaveAJust use Eric's package http://answers.unity3d.com/questions/314145/create-white-flash-like-an-edit-on-whole-view.html http://wiki.unity3d.com/index.php?title=Fade http://answers.unity3d.com/questions/19962/fade-in-from-black.html everyone uses it !
– FattieDave, let me try ... heh :) #Please hit 'edit', select your code, and hit the 101/010 button to format that code
– Fattie