Hi, I was wondering if this is intended behaviour.
My button fires again if I modify the existing OnClick EventDelegate during an OnClick event.
Basically I have a layered menu, and I want to go back one level, but instead because I modify the OnClick event of the same button during the execution of said event, it returns all the way down to the bottom level.
void Start()
{
backButton
.onClick.Add(new EventDelegate
(ShowMenu3
));}
void ShowMenu1()
{
...
}
void ShowMenu2()
{
...
backButton.onClick[0] = new EventDelegate
(ShowMenu1
); }
void ShowMenu3()
{
...
backButton.onClick[0] = new EventDelegate
(ShowMenu2
); }
One click on the button, and it goes all the way to ShowMenu1 , instead of stopping at the end of ShowMenu3.
If I comment out the
backButton
.onClick[0] = new EventDelegate
(ShowMenu2
);
then it stops at ShowMenu3.