"use strict";
var __reflect = (this && this.__reflect) || function (p, c, t) {
    p.__class__ = c, t ? t.push(c) : t = [c], p.__types__ = p.__types__ ? t.concat(p.__types__) : t;
};
var __extends = this && this.__extends || function __extends(t, e) { 
 function r() { 
 this.constructor = t;
}
for (var i in e) e.hasOwnProperty(i) && (t[i] = e[i]);
r.prototype = e.prototype, t.prototype = new r();
};
Object.defineProperty(exports, "__esModule", { value: true });
var ComponentBase_1 = require("../components/ComponentBase");
var Loading = (function (_super) {
    __extends(Loading, _super);
    function Loading() {
        var _this = _super.call(this) || this;
        _this.horizontalCenter = 0;
        _this.verticalCenter = 0;
        return _this;
    }
    Object.defineProperty(Loading, "instace", {
        get: function () {
            return Loading._instance || (Loading._instance = new Loading());
        },
        enumerable: true,
        configurable: true
    });
    Loading.prototype.show = function () {
        Loading._parent.addChild(this);
        if (this.skin && !this.hasEventListener(egret.Event.ENTER_FRAME))
            this.addEventListener(egret.Event.ENTER_FRAME, this.onEnterFrame, this);
    };
    Loading.prototype.hide = function () {
        Loading._parent.removeChild(this);
        if (this.hasEventListener(egret.Event.ENTER_FRAME))
            this.removeEventListener(egret.Event.ENTER_FRAME, this.onEnterFrame, this);
    };
    Loading.init = function (parent) {
        Loading._parent = parent;
    };
    Loading.prototype.onSkinComplete = function () {
        _super.prototype.onSkinComplete.call(this);
        if (!this.hasEventListener(egret.Event.ENTER_FRAME))
            this.addEventListener(egret.Event.ENTER_FRAME, this.onEnterFrame, this);
    };
    Loading.prototype.onEnterFrame = function () {
        this.data.speed += 5;
    };
    Object.defineProperty(Loading.prototype, "skinKey", {
        get: function () { return 'Loading'; },
        enumerable: true,
        configurable: true
    });
    return Loading;
}(ComponentBase_1.default));
exports.default = Loading;
__reflect(Loading.prototype, "\"/Users/chiwang/Desktop/\u5151\u5427\u5DE5\u4F5C/gameegret20181011/db-game-template/egret/src/loading/Loading\".Loading");
//# sourceMappingURL=Loading.js.map