Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - sbox

Pages: [1]
1
Seems odd that it requires that, but fair enough, thanks!

2
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.

  1. void Start()
  2. {
  3.                 backButton.onClick.Add(new EventDelegate(ShowMenu3));
  4. }
  5. void ShowMenu1()
  6. {
  7.                 ...
  8. }
  9. void ShowMenu2()
  10. {
  11.                 ...
  12.                 backButton.onClick[0] = new EventDelegate(ShowMenu1);
  13. }
  14. void ShowMenu3()
  15. {
  16.                 ...
  17.                 backButton.onClick[0] = new EventDelegate(ShowMenu2);
  18. }

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
  1. backButton.onClick[0] = new EventDelegate(ShowMenu2);
then it stops at ShowMenu3.

Pages: [1]