var texture1 : Texture2D;
var texture2 : Texture2D;
var AudioFile : AudioClip;
var alreadyUpdated = false;
function Update() {
if (!alreadyUpdated && Input.GetKey(KeyCode.X)) {
alreadyUpdated = true;
audio.clip = AudioFile;
audio.Play();
RenderSometing();
}
}
function RenderSometing() {
yield WaitForSeconds(1);
renderer.material.mainTexture = texture1;
yield WaitForSeconds(1);
renderer.material.mainTexture = texture2;
}
Fakt by sis měl o tom něco přečíst, tímhle stylem neuděláš vůbec nic.