static int OnPlay(IntPtr L)
    {
        try
        {
            ToLua.CheckArgsCount(L, 2);
            ToLua_DG_Tweening_Tween   obj  = (ToLua_DG_Tweening_Tween)ToLua.CheckObject(L, 1, typeof(ToLua_DG_Tweening_Tween));
            DG.Tweening.TweenCallback arg0 = null;
            LuaTypes funcType2             = LuaDLL.lua_type(L, 2);

            if (funcType2 != LuaTypes.LUA_TFUNCTION)
            {
                arg0 = (DG.Tweening.TweenCallback)ToLua.CheckObject(L, 2, typeof(DG.Tweening.TweenCallback));
            }
            else
            {
                LuaFunction func = ToLua.ToLuaFunction(L, 2);
                arg0 = DelegateFactory.CreateDelegate(typeof(DG.Tweening.TweenCallback), func) as DG.Tweening.TweenCallback;
            }

            DG.Tweening.Tween o = obj.OnPlay(arg0);
            ToLua.PushObject(L, o);
            return(1);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e));
        }
    }