Fix scheduler isScheduled not recognize schedules by key

This commit is contained in:
pandamicro
2017-11-01 00:22:49 +08:00
parent 90ca357dde
commit 0d99669301
+16
View File
@@ -91,6 +91,22 @@ cc.Scheduler.prototype.unschedule = function (callback, target) {
var key = instanceId + '_' + callback.__callbackId;
this._unschedule(key, target);
};
cc.Scheduler.prototype._isScheduled = cc.Scheduler.prototype.isScheduled;
cc.Scheduler.prototype.isScheduled = function (callback, target) {
if (typeof target === 'function') {
var tmp = target;
target = callback;
callback = tmp;
}
if (callback.__callbackId === undefined) {
return;
}
var instanceId = target.__instanceId || target.uuid;
cc.assertID(instanceId !== undefined, 1510);
var key = instanceId + '_' + callback.__callbackId;
this._isScheduled(key, target);
};
// Node
var nodeProto = cc.Node.prototype;