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; }
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; }