Hi guys, just wondering if there is a way to get a single object (not all objects) in front of my Texture2D. My scene fades out, I want everything to fade out apart from the character, is there any documentation you guys could point me to in order to aid me in achieving this effect? Would it be possible for me to implement it into this script?
public var fadeOutTexture : Texture2D;
public var fadeSpeed = 2.0;
var drawDepth = -1000;
private var alpha = 1.0;
private var fadeDir = -1;
function OnGUI(){
alpha += fadeDir * fadeSpeed * Time.deltaTime;
alpha = Mathf.Clamp01(alpha);
GUI.color.a = alpha;
GUI.depth = drawDepth;
GUI.DrawTexture(Rect(0, 0, Screen.width, Screen.height), fadeOutTexture);
}
function fadeIn(){
fadeDir = -1;
}
function fadeOut(){
fadeDir = 1;
}
function Start(){
alpha=1;
fadeIn();
}
That works,but is what I want possible?