I have some “buttons” I’ve made wizz around using iTween, I need them to be clickable to call functions, however they are GUITexture GameObjects, from the GameObject menu.
Can’t for the life of my figure out how to add function calls like
SwitchToSettingsScreen();
to a GUITexture in the same script with the var
var btnSettings : GameObject;
Is it even possible? The example I downloaded from iTween has “1 Player” “2 Player” “buttons” but they are not actually buttons, there is just one:
function Update(){
if(Input.GetMouseButtonDown(0)){
SwitchToSettingsScreen();
}
}
blanketing the screen for any type of click.
This is the sort of thing going on in my mind:
function Update(){
if (btnSettings.Input.GetMouseButtonDown(0)){
Debug.Log("clicked");
//SwitchToSettingsScreen();
}
}
But obviously this brings up the error:
‘Input’ is not a member
of ‘UnityEngine.GameObject’.
My code-fu isn’t yet strong enough to make this work