
                (function() {
                    var nodeEnv = typeof require !== 'undefined' && typeof process !== 'undefined';
                    var __module = nodeEnv ? module : {exports:{}};
                    var __filename = 'preview-scripts/assets/Script/prop/Star.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, 'd773dbWW6tAz6F+Z0L3IXUx', 'Star');
// Script/prop/Star.ts

"use strict";
// Learn TypeScript:
//  - https://docs.cocos.com/creator/manual/en/scripting/typescript.html
// Learn Attribute:
//  - https://docs.cocos.com/creator/manual/en/scripting/reference/attributes.html
// Learn life-cycle callbacks:
//  - https://docs.cocos.com/creator/manual/en/scripting/life-cycle-callbacks.html
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 (Object.prototype.hasOwnProperty.call(b, 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 Map_1 = require("../Map");
var _a = cc._decorator, ccclass = _a.ccclass, property = _a.property;
var Star = /** @class */ (function (_super) {
    __extends(Star, _super);
    function Star() {
        var _this = _super !== null && _super.apply(this, arguments) || this;
        _this.time = 60;
        // mapInfo: number[][] = [];
        _this.star_SpriteFrame = null;
        return _this;
        // update (dt) {}
    }
    Star.prototype.onLoad = function () {
    };
    Star.prototype.start = function () {
    };
    Star.prototype.init = function (time) {
        if (time)
            this.time = time;
        this.node.getChildByName("time").active = true;
        this.node.getChildByName("time").getComponent(cc.Label).string = this.time.toString();
        this.schedule(this.updateTime, 1);
    };
    Star.prototype.updateTime = function () {
        this.time--;
        this.node.getChildByName("time").getComponent(cc.Label).string = this.time.toString();
        if (this.time <= 0) {
            this.unschedule(this.updateTime);
            this.node.destroy();
            Map_1.default._instance.failLevel();
            // this.node.destroy();
        }
    };
    __decorate([
        property(cc.SpriteAtlas)
    ], Star.prototype, "star_SpriteFrame", void 0);
    Star = __decorate([
        ccclass
    ], Star);
    return Star;
}(cc.Component));
exports.default = Star;

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,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImFzc2V0c1xcU2NyaXB0XFxwcm9wXFxTdGFyLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7Ozs7Ozs7Ozs7Ozs7QUFBQSxvQkFBb0I7QUFDcEIsd0VBQXdFO0FBQ3hFLG1CQUFtQjtBQUNuQixrRkFBa0Y7QUFDbEYsOEJBQThCO0FBQzlCLGtGQUFrRjs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7O0FBRWxGLDhCQUFpQztBQUUzQixJQUFBLEtBQXNCLEVBQUUsQ0FBQyxVQUFVLEVBQWxDLE9BQU8sYUFBQSxFQUFFLFFBQVEsY0FBaUIsQ0FBQztBQUsxQztJQUFrQyx3QkFBWTtJQUE5QztRQUFBLHFFQW1DQztRQW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YyBfaW5zdGFuY2U6IGFueTtcclxuICAgIHRpbWU6IG51bWJlciA9IDYwO1xyXG5cclxuICAgIC8vIG1hcEluZm86IG51bWJlcltdW10gPSBbXTtcclxuICAgIEBwcm9wZXJ0eShjYy5TcHJpdGVBdGxhcylcclxuICAgIHN0YXJfU3ByaXRlRnJhbWU6IGNjLlNwcml0ZUF0bGFzID0gbnVsbDtcclxuXHJcbiAgICBvbkxvYWQgKCkge1xyXG5cclxuICAgIH0gXHJcblxyXG4gICAgc3RhcnQgKCkge1xyXG4gICAgfVxyXG5cclxuICAgIGluaXQodGltZSl7XHJcbiAgICAgICAgaWYodGltZSkgdGhpcy50aW1lID0gdGltZTtcclxuICAgICAgICB0aGlzLm5vZGUuZ2V0Q2hpbGRCeU5hbWUoXCJ0aW1lXCIpLmFjdGl2ZSA9IHRydWU7XHJcbiAgICAgICAgdGhpcy5ub2RlLmdldENoaWxkQnlOYW1lKFwidGltZVwiKS5nZXRDb21wb25lbnQoY2MuTGFiZWwpLnN0cmluZyA9IHRoaXMudGltZS50b1N0cmluZygpO1xyXG4gICAgICAgIHRoaXMuc2NoZWR1bGUodGhpcy51cGRhdGVUaW1lLCAxKTtcclxuICAgIH1cclxuXHJcbiAgICBcclxuICAgIHVwZGF0ZVRpbWUoKXtcclxuICAgICAgICB0aGlzLnRpbWUgLS07XHJcbiAgICAgICAgdGhpcy5ub2RlLmdldENoaWxkQnlOYW1lKFwidGltZVwiKS5nZXRDb21wb25lbnQoY2MuTGFiZWwpLnN0cmluZyA9IHRoaXMudGltZS50b1N0cmluZygpO1xyXG4gICAgICAgIGlmKHRoaXMudGltZSA8PSAwKXtcclxuICAgICAgICAgICAgdGhpcy51bnNjaGVkdWxlKHRoaXMudXBkYXRlVGltZSk7XHJcbiAgICAgICAgICAgIHRoaXMubm9kZS5kZXN0cm95KCk7XHJcbiAgICAgICAgICAgIE1hcENvbnJvbGVyLl9pbnN0YW5jZS5mYWlsTGV2ZWwoKTtcclxuICAgICAgICAgICAgLy8gdGhpcy5ub2RlLmRlc3Ryb3koKTtcclxuICAgICAgICB9XHJcbiAgICB9XHJcblxyXG4gICAgLy8gdXBkYXRlIChkdCkge31cclxufVxyXG4iXX0=