static public void RemoveListen(GameObject go) { UIEvents listener = go.GetComponent <UIEvents>(); if (listener != null) { Destroy(listener); } }
static public UIEvents Listen(GameObject go) { UIEvents listener = go.GetComponent <UIEvents>(); if (listener == null) { listener = go.AddComponent <UIEvents>(); } return(listener); }