Commit e1a98f7e authored by liujiangnan's avatar liujiangnan

feat: 改名

parent f69927c3
...@@ -3045,178 +3045,178 @@ ...@@ -3045,178 +3045,178 @@
var _JSON$stringify = unwrapExports(stringify); var _JSON$stringify = unwrapExports(stringify);
var componentEmitter = createCommonjsModule(function (module) { var componentEmitter = createCommonjsModule(function (module) {
/** /**
* Expose `Emitter`. * Expose `Emitter`.
*/ */
{ {
module.exports = Emitter; module.exports = Emitter;
} }
/** /**
* Initialize a new `Emitter`. * Initialize a new `Emitter`.
* *
* @api public * @api public
*/ */
function Emitter(obj) { function Emitter(obj) {
if (obj) return mixin(obj); if (obj) return mixin(obj);
} }
/** /**
* Mixin the emitter properties. * Mixin the emitter properties.
* *
* @param {Object} obj * @param {Object} obj
* @return {Object} * @return {Object}
* @api private * @api private
*/ */
function mixin(obj) { function mixin(obj) {
for (var key in Emitter.prototype) { for (var key in Emitter.prototype) {
obj[key] = Emitter.prototype[key]; obj[key] = Emitter.prototype[key];
} }
return obj; return obj;
} }
/** /**
* Listen on the given `event` with `fn`. * Listen on the given `event` with `fn`.
* *
* @param {String} event * @param {String} event
* @param {Function} fn * @param {Function} fn
* @return {Emitter} * @return {Emitter}
* @api public * @api public
*/ */
Emitter.prototype.on = Emitter.prototype.on =
Emitter.prototype.addEventListener = function(event, fn){ Emitter.prototype.addEventListener = function(event, fn){
this._callbacks = this._callbacks || {}; this._callbacks = this._callbacks || {};
(this._callbacks['$' + event] = this._callbacks['$' + event] || []) (this._callbacks['$' + event] = this._callbacks['$' + event] || [])
.push(fn); .push(fn);
return this; return this;
}; };
/** /**
* Adds an `event` listener that will be invoked a single * Adds an `event` listener that will be invoked a single
* time then automatically removed. * time then automatically removed.
* *
* @param {String} event * @param {String} event
* @param {Function} fn * @param {Function} fn
* @return {Emitter} * @return {Emitter}
* @api public * @api public
*/ */
Emitter.prototype.once = function(event, fn){ Emitter.prototype.once = function(event, fn){
function on() { function on() {
this.off(event, on); this.off(event, on);
fn.apply(this, arguments); fn.apply(this, arguments);
} }
on.fn = fn; on.fn = fn;
this.on(event, on); this.on(event, on);
return this; return this;
}; };
/** /**
* Remove the given callback for `event` or all * Remove the given callback for `event` or all
* registered callbacks. * registered callbacks.
* *
* @param {String} event * @param {String} event
* @param {Function} fn * @param {Function} fn
* @return {Emitter} * @return {Emitter}
* @api public * @api public
*/ */
Emitter.prototype.off = Emitter.prototype.off =
Emitter.prototype.removeListener = Emitter.prototype.removeListener =
Emitter.prototype.removeAllListeners = Emitter.prototype.removeAllListeners =
Emitter.prototype.removeEventListener = function(event, fn){ Emitter.prototype.removeEventListener = function(event, fn){
this._callbacks = this._callbacks || {}; this._callbacks = this._callbacks || {};
// all // all
if (0 == arguments.length) { if (0 == arguments.length) {
this._callbacks = {}; this._callbacks = {};
return this; return this;
} }
// specific event // specific event
var callbacks = this._callbacks['$' + event]; var callbacks = this._callbacks['$' + event];
if (!callbacks) return this; if (!callbacks) return this;
// remove all handlers // remove all handlers
if (1 == arguments.length) { if (1 == arguments.length) {
delete this._callbacks['$' + event]; delete this._callbacks['$' + event];
return this; return this;
} }
// remove specific handler // remove specific handler
var cb; var cb;
for (var i = 0; i < callbacks.length; i++) { for (var i = 0; i < callbacks.length; i++) {
cb = callbacks[i]; cb = callbacks[i];
if (cb === fn || cb.fn === fn) { if (cb === fn || cb.fn === fn) {
callbacks.splice(i, 1); callbacks.splice(i, 1);
break; break;
} }
} }
// Remove event specific arrays for event types that no // Remove event specific arrays for event types that no
// one is subscribed for to avoid memory leak. // one is subscribed for to avoid memory leak.
if (callbacks.length === 0) { if (callbacks.length === 0) {
delete this._callbacks['$' + event]; delete this._callbacks['$' + event];
} }
return this; return this;
}; };
/** /**
* Emit `event` with the given args. * Emit `event` with the given args.
* *
* @param {String} event * @param {String} event
* @param {Mixed} ... * @param {Mixed} ...
* @return {Emitter} * @return {Emitter}
*/ */
Emitter.prototype.emit = function(event){ Emitter.prototype.emit = function(event){
this._callbacks = this._callbacks || {}; this._callbacks = this._callbacks || {};
var args = new Array(arguments.length - 1) var args = new Array(arguments.length - 1)
, callbacks = this._callbacks['$' + event]; , callbacks = this._callbacks['$' + event];
for (var i = 1; i < arguments.length; i++) { for (var i = 1; i < arguments.length; i++) {
args[i - 1] = arguments[i]; args[i - 1] = arguments[i];
} }
if (callbacks) { if (callbacks) {
callbacks = callbacks.slice(0); callbacks = callbacks.slice(0);
for (var i = 0, len = callbacks.length; i < len; ++i) { for (var i = 0, len = callbacks.length; i < len; ++i) {
callbacks[i].apply(this, args); callbacks[i].apply(this, args);
} }
} }
return this; return this;
}; };
/** /**
* Return array of callbacks for `event`. * Return array of callbacks for `event`.
* *
* @param {String} event * @param {String} event
* @return {Array} * @return {Array}
* @api public * @api public
*/ */
Emitter.prototype.listeners = function(event){ Emitter.prototype.listeners = function(event){
this._callbacks = this._callbacks || {}; this._callbacks = this._callbacks || {};
return this._callbacks['$' + event] || []; return this._callbacks['$' + event] || [];
}; };
/** /**
* Check if this emitter has `event` handlers. * Check if this emitter has `event` handlers.
* *
* @param {String} event * @param {String} event
* @return {Boolean} * @return {Boolean}
* @api public * @api public
*/ */
Emitter.prototype.hasListeners = function(event){ Emitter.prototype.hasListeners = function(event){
return !! this.listeners(event).length; return !! this.listeners(event).length;
}; };
}); });
import { onHomeworkFinish, RandomInt, playAudio, playDragonBoneAnimation, getSprNode, popParticle, asyncDelay } from "../script/util"; import { onHomeworkFinish, RandomInt, playAudio, playDragonBoneAnimation, getSprNode, popParticle, asyncDelay } from "../script/util_Coloring_OL";
import { defaultData } from "../script/defaultData"; import { defaultData } from "../script/defaultData_Coloring_OL";
import { GameServer } from "../script/server"; import { GameServer } from "../script/server_Coloring_OL";
import { NetworkHelper } from "../script/NetworkHelper"; import { NetworkHelper } from "../script/NetworkHelper_Coloring_OL";
......
import { defaultData } from "./defaultData"; import { defaultData } from "./defaultData_Coloring_OL";
export class MyCocosSceneComponent extends cc.Component { export class MyCocosSceneComponent extends cc.Component {
......
import { RandomInt } from "./util"; import { RandomInt } from "./util_Coloring_OL";
export class NetworkHelper { export class NetworkHelper {
_eventListeners: any = {}; _eventListeners: any = {};
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
"height": 897, "height": 897,
"platformSettings": {}, "platformSettings": {},
"subMetas": { "subMetas": {
"bg_color-background": { "bg_color_background": {
"ver": "1.0.4", "ver": "1.0.4",
"uuid": "0b81d08b-946a-42e3-85e7-05f3c11abee6", "uuid": "0b81d08b-946a-42e3-85e7-05f3c11abee6",
"rawTextureUuid": "d9571c9c-a7cb-404e-9657-401315eeeb19", "rawTextureUuid": "d9571c9c-a7cb-404e-9657-401315eeeb19",
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
"height": 1121, "height": 1121,
"platformSettings": {}, "platformSettings": {},
"subMetas": { "subMetas": {
"bg_paint-background": { "bg_paint_background": {
"ver": "1.0.4", "ver": "1.0.4",
"uuid": "70df2531-8944-4d86-b3be-4ffcfc69121d", "uuid": "70df2531-8944-4d86-b3be-4ffcfc69121d",
"rawTextureUuid": "917dfb70-20da-4722-b3de-7b1ab17a8c9d", "rawTextureUuid": "917dfb70-20da-4722-b3de-7b1ab17a8c9d",
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
"height": 1429, "height": 1429,
"platformSettings": {}, "platformSettings": {},
"subMetas": { "subMetas": {
"bg_paint-background2": { "bg_paint_background2": {
"ver": "1.0.4", "ver": "1.0.4",
"uuid": "0c10e8dd-b7f7-428e-9912-6ecf6ea693c5", "uuid": "0c10e8dd-b7f7-428e-9912-6ecf6ea693c5",
"rawTextureUuid": "dc0bfde4-b674-46ed-8f7d-c9155569d130", "rawTextureUuid": "dc0bfde4-b674-46ed-8f7d-c9155569d130",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment