7473711f-e670-4903-b945-fc7d830fdb74.js
2.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
"use strict";
cc._RF.push(module, '74737Ef5nBJA7lF/H2DD9t0', 'SuitItem');
// script/game/ui/SuitItem.ts
"use strict";
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 });
const simba_cc_resutils_1 = require("simba-cc-resutils");
const CCDummyObjects_1 = require("../../common/CCDummyObjects");
const GameConstData_1 = require("../../common/gameplay/gamedata/GameConstData");
const UIManager_1 = require("../../common/gameplay/managers/UIManager");
const { ccclass, property } = cc._decorator;
let SuitItem = /** @class */ (() => {
let SuitItem = class SuitItem extends cc.Component {
constructor() {
super(...arguments);
this.iconSprite = CCDummyObjects_1.DummySprite;
this.nameLabel = CCDummyObjects_1.DummyLabel;
this.lockRootNode = CCDummyObjects_1.DummyNode;
this.unlockConditionLabel = CCDummyObjects_1.DummyLabel;
this._showLockRootNode = true;
}
async setData(suitConfig, showLockRootNode) {
this.iconSprite.spriteFrame = await simba_cc_resutils_1.ResUtils.loadRes(GameConstData_1.GameConstData.GAME_CONST_BEDROOMCAT_SUIT_SPR_DIR + suitConfig.clothingId, cc.SpriteFrame);
this.nameLabel.string = suitConfig.clothingName;
this._showLockRootNode = showLockRootNode;
if (showLockRootNode) {
this.lockRootNode.active = true;
this.unlockConditionLabel.string = suitConfig.unlockCondition;
}
}
onBtnClick() {
if (this._showLockRootNode) {
UIManager_1.UIManager.showToast("快去完成任务,领取服装吧!");
return;
}
}
};
__decorate([
property({ type: cc.Sprite, displayName: "Icon sprite" })
], SuitItem.prototype, "iconSprite", void 0);
__decorate([
property({ type: cc.Label, displayName: "Name label" })
], SuitItem.prototype, "nameLabel", void 0);
__decorate([
property({ type: cc.Node, displayName: "Lock root node" })
], SuitItem.prototype, "lockRootNode", void 0);
__decorate([
property({ type: cc.Label, displayName: "Unlock condition label" })
], SuitItem.prototype, "unlockConditionLabel", void 0);
SuitItem = __decorate([
ccclass
], SuitItem);
return SuitItem;
})();
exports.default = SuitItem;
cc._RF.pop();