DelayNoMore/frontend/assets/scripts/Fireball.js
2023-01-15 17:21:34 +08:00

30 lines
710 B
JavaScript

const Bullet = require("./Bullet");
cc.Class({
extends: Bullet,
ctor() {
this.lastUsed = -1;
this.bulletLocalId = -1;
this.speciesName = null;
},
setSpecies(speciesName, fireballBullet, rdf) {
if (speciesName == this.speciesName) return;
if (null != this.speciesName) {
for (let k in this.animNode.children) {
const child = this.children[k];
if (!child.active) continue;
if (child == effAnimNode || child.name == speciesName) continue;
child.active = false;
}
}
this.speciesName = speciesName;
this.effAnimNode = this.animNode.getChildByName(this.speciesName);
this.effAnimNode.active = true;
},
onLoad() {},
});