"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;
};
Object.defineProperty(exports, "__esModule", { value: true });
var SceneCtrl = (function () {
    function SceneCtrl() {
    }
    Object.defineProperty(SceneCtrl, "instance", {
        get: function () {
            return SceneCtrl._instance || (SceneCtrl._instance = new SceneCtrl());
        },
        enumerable: true,
        configurable: true
    });
    SceneCtrl.prototype.init = function (parent) {
        this._parent = parent;
    };
    SceneCtrl.prototype.change = function (cls, data) {
        var _this = this;
        var scene = new cls(data);
        this._parent.addChild(scene);
        scene.onSkinLoaded = function () {
            if (_this._currentScene) {
                _this._currentScene.destroy();
                _this._parent.removeChild(_this._currentScene);
            }
            _this._currentScene = scene;
        };
    };
    return SceneCtrl;
}());
exports.default = SceneCtrl;
__reflect(SceneCtrl.prototype, "\"c:/Users/duiba/Documents/zhonghe_answer/egret/src/ctrls/SceneCtrl\".SceneCtrl");
//# sourceMappingURL=SceneCtrl.js.map