Hello Guest

Author Topic: How could I bind/unbind the event of the uiItem dynamically?  (Read 3885 times)

cloudchen

  • Newbie
  • *
  • Posts: 16
    • View Profile
How could I bind/unbind the event of the uiItem dynamically?
« on: August 30, 2013, 12:25:12 pm »
I have lots of GameObjects in the scene, and each of them attached a tk2dUIItem object. Since the event(method) bound to each of the GameObject need some time to wait the completeness of the AssetBundle download job, I would like to avoid user triggering the event bound to other GameObject during the period of loading.

How could I toggle the bound event dynamically or there are other better solutions? Thanks and wait for your kindly aid.

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: How could I bind/unbind the event of the uiItem dynamically?
« Reply #1 on: August 30, 2013, 12:36:55 pm »
How are you binding the event in the first place? Is it by drag and drop? If so - simply set the SendMessageOnClickMethodName = "" and then set it back when you're done.

Otherwise, simply unsubscribe from the event and resubscribe later when its enabled.