public static void AddListener(GameObject obj, LuaFunction clickFunc, LuaFunction downFunc, LuaFunction upFunc) { if (obj.GetComponent <ClickListener>() == null) { obj.AddComponent <ClickListener>(); } ClickListener click = obj.GetComponent <ClickListener>(); click.AddClickListener(() => { clickFunc.Call(); }); click.AddListener(() => { downFunc.Call(); }, () => { upFunc.Call(); }); }