コード例 #1
0
        static public void RemoveListen(GameObject go)
        {
            UIEvents listener = go.GetComponent <UIEvents>();

            if (listener != null)
            {
                Destroy(listener);
            }
        }
コード例 #2
0
        static public UIEvents Listen(GameObject go)
        {
            UIEvents listener = go.GetComponent <UIEvents>();

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