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L,CAAC,EA9BgB,aAAa,GAAb,qBAAa,KAAb,qBAAa,QA8B7B","file":"","sourceRoot":"/","sourcesContent":["export namespace ScheduleUtils {\n let scheduleWrapper: { new(func: (dt: number) => void): Object };\n let scheduleWrapperId = 0;\n\n function getSchedulerWrapper(func: (dt: number) => void): Object {\n if ((func as any)._wrapper) return (func as any)._wrapper;\n if (!scheduleWrapper) {\n scheduleWrapper = cc.Class({\n name: \"cc.schedulerWrapper\",\n ctor: function (func: (dt: number) => void) {\n (this as any).func = func;\n },\n update: function (dt: number) {\n (this as any).func(dt);\n }\n }) as typeof scheduleWrapper;\n }\n let wrapper = (func as any)._wrapper = new scheduleWrapper(func);\n (wrapper as any)._id = \"avg_schedule_wrapper_\" + (scheduleWrapperId++);\n return wrapper;\n }\n\n export function scheduleUpdate(target: (dt: number) => void) {\n cc.director.getScheduler().scheduleUpdate(getSchedulerWrapper(target), 0, false);\n }\n\n export function unscheduleUpdate(target: (dt: number) => void) {\n if ((target as any)._wrapper)\n cc.director.getScheduler().unscheduleUpdate((target as any)._wrapper);\n }\n}"]}