Hi, I am trying to enable an UI Button, but I cant....I want to enable my script with the function (On Click)
adding the Update function. But it doesn't work.
Basically I want to change the transparency or visibility (alpha) with this button
Please any advice is more than welcome.
private var a : float = 1; // alpha starts at 1
var fadeSpeed : float = 2;
private var Green : b!oolean = true;
function Update(){
if(Green == true){
GetComponent.().material.color.a = Mathf.Lerp(GetComponent.().material.color.a, 1, Time.deltaTime * fadeSpeed);
}else{
GetComponent.().material.color.a = Mathf.Lerp(GetComponent.().material.color.a, 0, Time.deltaTime * fadeSpeed);
}
}![alt text][1]
[1]: /storage/temp/56618-capture.jpg
↧