123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869 |
- const { ArtistTrainItemSkillStyle } = require('../utils/GameEnum');
- const DWTool = require("../utils/DWTool");
- cc.Class({
- extends: cc.Component,
- properties: {
-
- skillSprite: cc.Sprite,
- title: cc.Label,
- scoreLabel: cc.Label,
- upSprite: cc.Sprite
- },
-
- init(data, style) {
- this.style = style;
-
- switch (data, style) {
- case ArtistTrainItemSkillStyle.Ability:
- this.title.string = "能力提升:";
- this.scoreLabel.string = `+${data.addAbility}`;
- DWTool.loadResSpriteFrame('./artistTrain/big_ability')
- .then((spriteFrame) => {
- this.skillSprite.spriteFrame = spriteFrame;
- });
-
- break;
- case ArtistTrainItemSkillStyle.Charm:
- this.title.string = "魅力提升:";
- this.scoreLabel.string = `+${data.addCharm}`;
- DWTool.loadResSpriteFrame('./artistTrain/big_charm')
- .then((spriteFrame) => {
- this.skillSprite.spriteFrame = spriteFrame;
- });
-
- break;
- case ArtistTrainItemSkillStyle.Effect:
-
- this.title.string = "影响力提升:";
- this.scoreLabel.string = `+${data.addEffect}`;
- DWTool.loadResSpriteFrame('./artistTrain/big_effect')
- .then((spriteFrame) => {
- this.skillSprite.spriteFrame = spriteFrame;
- });
-
- break;
- default:
- break;
- }
- },
- onLoad () {
- },
- start () {
- },
-
- });
|