d5e91df4-5b64-4df5-8d4a-c4a12a6b4a43.js
2.11 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
"use strict";
cc._RF.push(module, 'd5e9130W2RN9Y1KxKEqa0pD', 'SectionBtn');
// script/game/ui/SectionBtn.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 CCDummyObjects_1 = require("../../common/CCDummyObjects");
const { ccclass, property } = cc._decorator;
let SectionBtn = /** @class */ (() => {
let SectionBtn = class SectionBtn extends cc.Component {
constructor() {
super(...arguments);
this.label = CCDummyObjects_1.DummyLabel;
this.pointSpr = CCDummyObjects_1.DummyNode;
}
setData(chapterId, chapterName, isCurrChapter, callback) {
this._callback = callback;
this.label.string = chapterId.toString() + "." + chapterName;
if (isCurrChapter) {
this.pointSpr.active = true;
cc.tween(this.pointSpr)
.repeatForever(cc.tween()
.to(0.5, { scale: 1.15, x: -25 }, { easing: 'sineInOut' })
.to(0.5, { scale: 1, x: -30 }, { easing: 'sineInOut' }))
.start();
this.label.node.color = cc.color(255, 238, 149, 255);
}
}
onItemClick() {
this._callback();
}
};
__decorate([
property(cc.Label)
], SectionBtn.prototype, "label", void 0);
__decorate([
property(cc.Node)
], SectionBtn.prototype, "pointSpr", void 0);
SectionBtn = __decorate([
ccclass
], SectionBtn);
return SectionBtn;
})();
exports.default = SectionBtn;
cc._RF.pop();