"use strict"; cc._RF.push(module, '805c6nf399HWZeuWnNB9CTH', 'GameOver'); // Script/GameOver.ts "use strict"; 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 GameAppStart_1 = require("./module/GameStart/GameAppStart"); var _a = cc._decorator, ccclass = _a.ccclass, property = _a.property; var NewClass = /** @class */ (function (_super) { __extends(NewClass, _super); function NewClass() { var _this = _super !== null && _super.apply(this, arguments) || this; _this.count = null; _this.time = null; _this.selfNode = null; _this.one = null; _this.two = null; _this.three = null; _this.four = null; _this.five = null; return _this; } // onLoad () {} NewClass.prototype.start = function () { this.count.string = GameAppStart_1.Fx.GameConfig.GM_INFO.total + ""; if (GameAppStart_1.Fx.GameConfig.GM_INFO.mean_Time > 10) { GameAppStart_1.Fx.GameConfig.GM_INFO.mean_Time = (parseInt(Math.random() * 10 + "") + 5) / 10; } this.time.string = GameAppStart_1.Fx.GameConfig.GM_INFO.mean_Time + "s"; this.init(); }; //初始化数据 NewClass.prototype.init = function () { this.listData = []; this.selfData = null; this.one.active = false; this.two.active = false; this.three.active = false; this.four.active = false; this.five.active = false; this.getRank(); }; //打开排行榜 NewClass.prototype.openRank = function () { cc.director.loadScene("RankScene"); }; //重新开始玩 NewClass.prototype.again = function () { cc.director.loadScene("GameScene"); }; //获取排行榜 NewClass.prototype.getRank = function () { var _this = this; //获取排行榜数据 所需数据量 var dataFile = { length: 5 }; GameAppStart_1.Fx.GameTool.getRank(dataFile, function (data) { return _this.getRankData(data); }); }; //设置排行信息 NewClass.prototype.getRankData = function (data) { if (data) { GameAppStart_1.Fx.GameTool.getRankData(data, this, 4); GameAppStart_1.Fx.GameTool.setPic(this.selfNode.getChildByName("pic").getChildByName("icon"), this.selfData.pic); for (var i = 0; i <= 4; i++) { this.setRank(i, this.listData[i]); } } }; //根据内容填充排行榜 NewClass.prototype.setRank = function (num, data) { var hitNode = null; if (num == 0) { hitNode = this.one; } else if (num == 1) { hitNode = this.two; } else if (num == 2) { hitNode = this.three; } else if (num == 3) { hitNode = this.four; } else if (num == 4) { hitNode = this.five; } if (hitNode) { hitNode.active = true; GameAppStart_1.Fx.GameTool.subName(data.nickName, 4); hitNode.getChildByName("name").getComponent(cc.Label).string = data.nickName; hitNode.getChildByName("total").getComponent(cc.Label).string = data.totalSunCount; GameAppStart_1.Fx.GameTool.setPic(hitNode.getChildByName("pic").getChildByName("icon"), data.pic); } }; __decorate([ property(cc.Label) ], NewClass.prototype, "count", void 0); __decorate([ property(cc.Label) ], NewClass.prototype, "time", void 0); __decorate([ property(cc.Node) ], NewClass.prototype, "selfNode", void 0); __decorate([ property(cc.Node) ], NewClass.prototype, "one", void 0); __decorate([ property(cc.Node) ], NewClass.prototype, "two", void 0); __decorate([ property(cc.Node) ], NewClass.prototype, "three", void 0); __decorate([ property(cc.Node) ], NewClass.prototype, "four", void 0); __decorate([ property(cc.Node) ], NewClass.prototype, "five", void 0); NewClass = __decorate([ ccclass ], NewClass); return NewClass; }(cc.Component)); exports.default = NewClass; cc._RF.pop();