Esempio n. 1
0
        //删除事件
        public static void ClearEvents(GameObject obj)
        {
            UIEventSystem evtSystem = obj.GetComponent <UIEventSystem>();

            if (evtSystem != null)
            {
                evtSystem.triggers.Clear();
            }
        }
Esempio n. 2
0
        //添加事件组件
        public static UIEventSystem Get(GameObject obj)
        {
            UIEventSystem evtSystem = obj.GetComponent <UIEventSystem>();

            if (evtSystem == null)
            {
                evtSystem = obj.AddComponent <UIEventSystem>();
            }
            return(evtSystem);
        }