No ty totiž máš sice v nadpise Javascript, ale jedná se o trochu odlišný unity javascript.
var texture1 : Texture2D;
var texture2 : Texture2D;
var alreadyUpdated = false;
var udelat;
function Update() {
if (!alreadyUpdated && Input.GetKey(KeyCode.X)) {
alreadyUpdated = true;
RenderSometing();
InvokeRepeating("povolKlavesu", .01, 30.0);
}
}
function RenderSometing() {
yield WaitForSeconds(9);
renderer.material.mainTexture = texture1;
yield WaitForSeconds(9);
renderer.material.mainTexture = texture2;
}
function povolKlavesu () {
alreadyUpdated = false;
}