Esempio n. 1
0
        static public void RemoveListen(GameObject go)
        {
            UIEvents listener = go.GetComponent <UIEvents>();

            if (listener != null)
            {
                Destroy(listener);
            }
        }
Esempio n. 2
0
        static public UIEvents Listen(GameObject go)
        {
            UIEvents listener = go.GetComponent <UIEvents>();

            if (listener == null)
            {
                listener = go.AddComponent <UIEvents>();
            }
            return(listener);
        }