mirror of
https://github.com/cocos/cocos4.git
synced 2026-12-02 08:42:43 +08:00
Fix scheduler isScheduled not recognize schedules by key
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user