Tasharen Entertainment Forum

Support => NGUI 3 Support => Topic started by: ggmann on November 05, 2012, 03:13:06 AM

Title: NGUI Buttons target and component based singleton
Post by: ggmann on November 05, 2012, 03:13:06 AM
i have  singleton GameManager, there is function Play which i want call with ButtonMessage but, i set as target GameObject with this singleton and after reloading Scene connection between ButtonMessage target and singleton loose, singleton live but target setted to the other singleton which destroy if already exist one.

what i doing wrong ?
Title: Re: NGUI Buttons target and component based singleton
Post by: ArenMook on November 05, 2012, 04:46:18 AM
What does a singleton have to do with a button?
Title: Re: NGUI Buttons target and component based singleton
Post by: Nicki on November 05, 2012, 10:57:30 AM
Rewrite the NGUI button to use your singleton if you want to use it.

Instead of sending to target, it should just call:

GameManager.Instance.Method();