
                (function() {
                    var nodeEnv = typeof require !== 'undefined' && typeof process !== 'undefined';
                    var __module = nodeEnv ? module : {exports:{}};
                    var __filename = 'preview-scripts/assets/Script/Helloworld.js';
                    var __require = nodeEnv ? function (request) {
                        return cc.require(request);
                    } : function (request) {
                        return __quick_compile_project__.require(request, __filename);
                    };
                    function __define (exports, require, module) {
                        if (!nodeEnv) {__quick_compile_project__.registerModule(__filename, module);}"use strict";
cc._RF.push(module, 'e1b90/rohdEk4SdmmEZANaD', 'Helloworld');
// Script/Helloworld.ts

"use strict";
/*
 * @Description:
 * @Author: xxx
 * @Date: 2020-05-11 14:03:43
 * @LastEditor: xxx
 * @LastEditTime: 2020-07-24 17:57:45
 */
var __extends = (this && this.__extends) || (function () {
    var extendStatics = function (d, b) {
        extendStatics = Object.setPrototypeOf ||
            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
            function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
        return extendStatics(d, b);
    };
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
Object.defineProperty(exports, "__esModule", { value: true });
var _a = cc._decorator, ccclass = _a.ccclass, property = _a.property;
var Helloworld = /** @class */ (function (_super) {
    __extends(Helloworld, _super);
    function Helloworld() {
        var _this = _super !== null && _super.apply(this, arguments) || this;
        _this.label = null;
        _this.text = "hello";
        _this._icons = [];
        return _this;
    }
    Helloworld.prototype.start = function () {
        // init logic
        // this.label.string = this.text;
        cc.macro.CLEANUP_IMAGE_CACHE = true;
        this.node.on(cc.Node.EventType.TOUCH_END, this.onClick, this);
    };
    Helloworld.prototype.onClick = function () {
        var _this = this;
        this._icons.forEach(function (icon) {
            icon.destroy();
            icon.removeFromParent();
        });
        this._icons = [];
        var count = 1;
        for (var i = 1; i <= count; i++) {
            cc.resources.load("icon_" + i, cc.SpriteFrame, function (err, sf) {
                if (err)
                    return;
                var node = new cc.Node();
                node.addComponent(cc.Sprite).spriteFrame = sf;
                _this.node.addChild(node);
                _this._icons.push(node);
                console.log("add icon success!");
            });
        }
    };
    __decorate([
        property(cc.Label)
    ], Helloworld.prototype, "label", void 0);
    __decorate([
        property
    ], Helloworld.prototype, "text", void 0);
    Helloworld = __decorate([
        ccclass
    ], Helloworld);
    return Helloworld;
}(cc.Component));
exports.default = Helloworld;

cc._RF.pop();
                    }
                    if (nodeEnv) {
                        __define(__module.exports, __require, __module);
                    }
                    else {
                        __quick_compile_project__.registerModuleFunc(__filename, function () {
                            __define(__module.exports, __require, __module);
                        });
                    }
                })();
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImFzc2V0cy9TY3JpcHQvSGVsbG93b3JsZC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7Ozs7Ozs7O0FBQUE7Ozs7OztHQU1HOzs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7QUFFRyxJQUFBLEtBQXdCLEVBQUUsQ0FBQyxVQUFVLEVBQW5DLE9BQU8sYUFBQSxFQUFFLFFBQVEsY0FBa0IsQ0FBQztBQUc1QztJQUF3Qyw4QkFBWTtJQUFwRDtRQUFBLHFFQXdDQztRQXRDRyxXQUFLLEdBQWEsSUFBSSxDQUFDO1FBR3ZCLFVBQUksR0FBVyxPQUFPLENBQUM7UUFFdkIsWUFBTSxHQUFjLEVBQUUsQ0FBQzs7S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luaXQgbG9naWNcbiAgICAgICAgLy8gdGhpcy5sYWJlbC5zdHJpbmcgPSB0aGlzLnRleHQ7XG5cbiAgICAgICAgY2MubWFjcm8uQ0xFQU5VUF9JTUFHRV9DQUNIRSA9IHRydWU7XG5cbiAgICAgICAgdGhpcy5ub2RlLm9uKGNjLk5vZGUuRXZlbnRUeXBlLlRPVUNIX0VORCwgdGhpcy5vbkNsaWNrLCB0aGlzKTtcbiAgICB9XG5cbiAgICBvbkNsaWNrKCkge1xuICAgICAgICB0aGlzLl9pY29ucy5mb3JFYWNoKChpY29uKSA9PiB7XG4gICAgICAgICAgICBpY29uLmRlc3Ryb3koKTtcbiAgICAgICAgICAgIGljb24ucmVtb3ZlRnJvbVBhcmVudCgpO1xuICAgICAgICB9KTtcbiAgICAgICAgdGhpcy5faWNvbnMgPSBbXTtcblxuICAgICAgICBjb25zdCBjb3VudCA9IDE7XG4gICAgICAgIGZvciAobGV0IGkgPSAxOyBpIDw9IGNvdW50OyBpKyspIHtcbiAgICAgICAgICAgIGNjLnJlc291cmNlcy5sb2FkKFwiaWNvbl9cIiArIGksIGNjLlNwcml0ZUZyYW1lLCAoZXJyLCBzZjogY2MuU3ByaXRlRnJhbWUpID0+IHtcbiAgICAgICAgICAgICAgICBpZiAoZXJyKSByZXR1cm47XG5cbiAgICAgICAgICAgICAgICBjb25zdCBub2RlOiBjYy5Ob2RlID0gbmV3IGNjLk5vZGUoKTtcbiAgICAgICAgICAgICAgICBub2RlLmFkZENvbXBvbmVudChjYy5TcHJpdGUpLnNwcml0ZUZyYW1lID0gc2Y7XG5cbiAgICAgICAgICAgICAgICB0aGlzLm5vZGUuYWRkQ2hpbGQobm9kZSk7XG4gICAgICAgICAgICAgICAgdGhpcy5faWNvbnMucHVzaChub2RlKTtcblxuICAgICAgICAgICAgICAgIGNvbnNvbGUubG9nKFwiYWRkIGljb24gc3VjY2VzcyFcIik7XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfVxuICAgIH1cbn1cbiJdfQ==