123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869 |
- const DWTool = require("../utils/DWTool");
- const { ArtistTrainItemSkillStyle } = require('../utils/GameEnum');
- cc.Class({
- extends: cc.Component,
- properties: {
-
- content: cc.Node,
- subContent: cc.Node,
- },
- init(data) {
- this.data = data;
- this.setSkillLayout();
- },
- // LIFE-CYCLE CALLBACKS:
- onLoad () {},
- start () {
- this.content.scaleX = 0;
- this.content.scaleY = 0;
- this.content.runAction(cc.scaleTo(0.35, 1, 1).easing(cc.easeBackOut()));
- },
- setSkillLayout() {
- DWTool.loadResPrefab("./prefabs/artist_train_completion_skill")
- .then((prefab) => {
-
- if (this.data.addCharm != 0) {
- let item = cc.instantiate(prefab);
- this.subContent.addChild(item);
- item.getComponent('ArtistTrainCompletionSkill').init(this.data, ArtistTrainItemSkillStyle.Charm);
- }
- if (this.data.addAbility != 0) {
- let item = cc.instantiate(prefab);
- this.subContent.addChild(item);
- item.getComponent('ArtistTrainCompletionSkill').init(this.data, ArtistTrainItemSkillStyle.Ability);
- }
- if (this.data.addEffect != 0) {
- let item = cc.instantiate(prefab);
- this.subContent.addChild(item);
- item.getComponent('ArtistTrainCompletionSkill').init(this.data, ArtistTrainItemSkillStyle.Effect);
- }
- });
- },
- dissmiss() {
- let finish = cc.callFunc(() => {
- this.node.destroy();
- }, this);
- let sequence = cc.sequence(cc.scaleTo(0.2, 0, 0).easing(cc.easeBackIn()), finish)
- this.content.runAction(sequence);
- },
- close() {
- this.dissmiss();
- }
- // update (dt) {},
- });
|