예제 #1
0
        protected void AddClickEvent(GameObject obj,
                                     CustomEventTrigger.Callback callback,
                                     params object[] args)
        {
            CustomEventTrigger evt = obj.GetComponent <CustomEventTrigger>();

            if (!evt)
            {
                evt = obj.AddComponent <CustomEventTrigger>();
            }

            evt.Args              = args;
            evt.Callback_OnClick += callback;
        }
예제 #2
0
        protected void AddTouchEvent(GameObject obj,
                                     CustomEventTrigger.Callback begin_callback,
                                     CustomEventTrigger.Callback end_callback,
                                     params object[] args)
        {
            CustomEventTrigger evt = obj.GetComponent <CustomEventTrigger>();

            if (!evt)
            {
                evt = obj.AddComponent <CustomEventTrigger>();
            }

            evt.Args = args;
            evt.Callback_OnBeginDrag += begin_callback;
            evt.Callback_OnEndDrag   += end_callback;
        }