mirror of
https://github.com/cocos/cocos4.git
synced 2026-12-01 07:42:38 +08:00
Remove dependency of cc._Class from EventManager
d
This commit is contained in:
@@ -26,14 +26,13 @@ var js = require('../platform/js');
|
||||
require('./CCEventListener');
|
||||
var ListenerID = cc.EventListener.ListenerID;
|
||||
|
||||
var _EventListenerVector = cc._Class.extend({
|
||||
|
||||
ctor: function () {
|
||||
this._fixedListeners = [];
|
||||
this._sceneGraphListeners = [];
|
||||
this.gt0Index = 0;
|
||||
},
|
||||
|
||||
var _EventListenerVector = function () {
|
||||
this._fixedListeners = [];
|
||||
this._sceneGraphListeners = [];
|
||||
this.gt0Index = 0;
|
||||
};
|
||||
_EventListenerVector.prototype = {
|
||||
constructor: _EventListenerVector,
|
||||
size: function () {
|
||||
return this._fixedListeners.length + this._sceneGraphListeners.length;
|
||||
},
|
||||
@@ -69,7 +68,7 @@ var _EventListenerVector = cc._Class.extend({
|
||||
getSceneGraphPriorityListeners: function () {
|
||||
return this._sceneGraphListeners;
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
var __getListenerID = function (event) {
|
||||
var eventType = cc.Event, type = event.type;
|
||||
|
||||
@@ -32,13 +32,12 @@
|
||||
* @param {Number} y
|
||||
* @param {Number} id
|
||||
*/
|
||||
cc.Touch = cc._Class.extend(/** @lends cc.Touch# */{
|
||||
|
||||
ctor:function (x, y, id) {
|
||||
this._lastModified = 0;
|
||||
this.setTouchInfo(id, x, y);
|
||||
},
|
||||
|
||||
cc.Touch = function (x, y, id) {
|
||||
this._lastModified = 0;
|
||||
this.setTouchInfo(id, x, y);
|
||||
};
|
||||
cc.Touch.prototype = {
|
||||
constructor: cc.Touch,
|
||||
/**
|
||||
* !#en Returns the current touch location in OpenGL coordinates.、
|
||||
* !#zh 获取当前触点位置。
|
||||
@@ -180,4 +179,4 @@ cc.Touch = cc._Class.extend(/** @lends cc.Touch# */{
|
||||
else
|
||||
this._prevPoint = cc.p(x || 0, y || 0);
|
||||
}
|
||||
});
|
||||
};
|
||||
Reference in New Issue
Block a user