Hi dudes,
im really new to Unity and im trying to figure out how to call a function in another JS script but have failed miserably ![]()
im trying to get a GUI Texture to reveal itself, can anyone help?
ok, so hears what i got:
- A GUI Texture called Game-Over-Panel
- A script called āhealth_Controlā that triggers the GUI Script:
function Update () {
switch(LIVES)
{
case 3:
guiTexture.texture = health3;
break;
case 2:
guiTexture.texture = health2;
break;
case 1:
guiTexture.texture = health1;
break;
case 0:
//GameOver();
activatescript.DisplayGameOver();
break;
}
}
- A Script called āGUIā That has a function in it:
var MyGameOver : Texture2D;
function DisplayGameOver () {
Debug.Log("test");
guiTexture.texture = MyGameOver;
}
How can i talk to the GUI script and run the function??
cheers