I have a UI Image in my scene. I want it to turn off when you hold a button. I have a script that turns off a GUI Texture, but I don’t know how to change it. Here’s my code…
var aimTexture : GUITexture;
function Update() {
// Only enable aim texture when 'Aim' button is not pressed.
// In this case I have used 'Shift' key for this.
if (Input.GetButton("Aim"))
aimTexture.enabled = true;
else
aimTexture.enabled = false;
}