Пример #1
0
        public static void SetListClickFunc(GameObject go)
        {
            UGUIEventForList listerner = GetOrAddComponent <UGUIEventForList>(go);

            listerner.onClick = delegate(GameObject obj)
            {
                if (go == null)
                {
                    return;
                }
            };
        }
Пример #2
0
        public static System.Action <GameObject> GetListClickFunc(GameObject go)
        {
            UGUIEventForList listerner = go.GetComponent <UGUIEventForList>();

            if (listerner)
            {
                return(listerner.onClick);
            }
            else
            {
                return(null);
            }
        }
Пример #3
0
    public void RemoveListPress(GameObject go)
    {
        if (go == null)
        {
            return;
        }
        UGUIEventForList listerner = go.GetComponent <UGUIEventForList>();

        if (listerner == null)
        {
            return;
        }
        listerner.onPress = null;
    }
Пример #4
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);
        };
    }
Пример #5
0
        public static void SetListClickFunc(GameObject go, System.Action <GameObject> cb)
        {
            UGUIEventForList listerner = GetOrAddComponent <UGUIEventForList>(go);

            listerner.onClick = cb;
        }