public void AddListPress(GameObject go, UGUIEventListener.VoidDelegate func) { if (go == null) { return; } Graphic graphic = go.GetComponent <Graphic>(); if (graphic != null) { graphic.raycastTarget = true; } UGUIEventForList listerner = Utility.GameUtility.GetOrAddComponent <UGUIEventForList>(go); listerner.onPress = delegate(GameObject obj) { OnClick(obj, func); }; }
public static void SetClickFunc(GameObject go, UGUIEventListener.VoidDelegate cb) { UGUIEventListener listerner = GetOrAddComponent <UGUIEventListener>(go); listerner.onClick = cb; }