I want to make Javascript so that in Credits GUI an image pops up after 10 seconds.
So 10 seconds the text scrolls and then script takes place: an image pops up suddenly. This is my code so far but i got stuck:
public var myVar:float = eventTimer (10);
private var timeElapsed (0);
function Start () {
}
yield WaitForSeconds (10);
function OnGUI () {
if(aTexture == null) {
Debug.LogError("Assign a Texture in the inspector.");
return;
}
else if(timeElapsed >= eventTimer){
GUI.DrawTexture(Rect(10,10,60,60),aTexture,ScaleMode.ScaleToFit,true,10.0f);
}
function () Update; {
timeElapsed = Time.deltatime;
if(timeElasped >= eventTimer){ /*GUIDrawTextureFunction*/};
timeElapsed = 0;
}
↧