
                (function() {
                    var nodeEnv = typeof require !== 'undefined' && typeof process !== 'undefined';
                    var __module = nodeEnv ? module : {exports:{}};
                    var __filename = 'preview-scripts/assets/Script/prop/Freeze.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, 'ad8cbbzCohCR5uifssdRTf+', 'Freeze');
// Script/prop/Freeze.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 NumberToImage_1 = require("../NumberToImage");
var _a = cc._decorator, ccclass = _a.ccclass, property = _a.property;
var Freeze = /** @class */ (function (_super) {
    __extends(Freeze, _super);
    function Freeze() {
        var _this = _super !== null && _super.apply(this, arguments) || this;
        _this.time = 60;
        _this.freeze = null;
        return _this;
        // update (dt) {}
    }
    // mapInfo: number[][] = [];
    Freeze.prototype.onLoad = function () {
    };
    Freeze.prototype.start = function () {
    };
    Freeze.prototype.init = function (time, type) {
        if (time)
            this.time = time;
        this.node.getChildByName("time").active = true;
        NumberToImage_1.default.numberToImageNodes(this.time, 40, 25, "ice_", this.node.getChildByName("time"), false);
        // this.node.getChildByName("time").getComponent(cc.Label).string = this.time.toString();
    };
    Freeze.prototype.reduce = function (number) {
        var _this = this;
        this.time -= number;
        if (this.time <= 0)
            this.time = 0;
        NumberToImage_1.default.numberToImageNodes(this.time, 40, 25, "ice_", this.node.getChildByName("time"), false);
        // this.node.getChildByName("time").getComponent(cc.Label).string = this.time.toString();
        if (this.time <= 0) {
            this.node.getChildByName("bingkuai").active = true;
            var skeleton = this.node.getChildByName("bingkuai").getComponent(sp.Skeleton);
            skeleton.setAnimation(1, "bingkuai", false);
            this.node.getChildByName("icon").active = true;
            this.node.getChildByName("time").active = false;
            cc.tween(this.node.getChildByName("icon"))
                .to(0.5, { opacity: 0 })
                .start();
            // this.node.getChildByName("icon").getComponent(cc.Sprite).setMaterial(0,this.freeze);
            // this.node.children.forEach(element => {
            //     element.destroy();
            // });
            setTimeout(function () {
                _this.node.parent.getComponent("Block").resetFreeze();
                _this.node.destroy();
                _this.node.removeFromParent();
            }, 600);
        }
    };
    __decorate([
        property(cc.Material)
    ], Freeze.prototype, "freeze", void 0);
    Freeze = __decorate([
        ccclass
    ], Freeze);
    return Freeze;
}(cc.Component));
exports.default = Freeze;

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,[encoded data, 6132 characters]