Ejemplo n.º 1
0
    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);
        };
    }
Ejemplo n.º 2
0
        public static void SetClickFunc(GameObject go, UGUIEventListener.VoidDelegate cb)
        {
            UGUIEventListener listerner = GetOrAddComponent <UGUIEventListener>(go);

            listerner.onClick = cb;
        }