Hello,
Im looking for some help on handling events on GUI.Button or GUI.Repeat Button, but unfortunately i didnt find any source that states the use of any event handler in OnGUI()
What i am trying is to call a function1 when a button is pressed , function2 when it is hovered function3 if it is released
To call function1 when button is pressed , im using :-
function OnGUI()
{
if ( GUI.RepeatButton(Rect(10,10,50,50),“PressMe”) )
{
function1();
}
else
{
function3();
// I want the function 3 to be called when button is released but it is being called every frame even if i have not pressed the button for a single time, and i know it will so bcz ongui will be check the else block evey frame
}
}
if anybody has done similar work, then plz help me with some code or logic
Thanks
…LiVeN…