DelayNoMore/frontend/assets/scripts/Fireball.js

30 lines
724 B
JavaScript
Raw Normal View History

const Bullet = require("./Bullet");
2023-01-11 10:09:18 +00:00
cc.Class({
extends: Bullet,
2023-01-13 03:25:20 +00:00
2023-01-11 10:09:18 +00:00
ctor() {
this.lastUsed = -1;
this.bulletLocalId = -1;
this.speciesName = null;
},
2023-01-11 14:24:31 +00:00
setSpecies(speciesName, fireballBullet, rdf) {
2023-01-11 10:09:18 +00:00
if (speciesName == this.speciesName) return;
2023-01-13 03:25:20 +00:00
if (null != this.speciesName) {
for (let k in this.animNode.children) {
const child = this.animNode.children[k];
2023-01-13 03:25:20 +00:00
if (!child.active) continue;
if (child == this.effAnimNode || child.name == speciesName) continue;
2023-01-13 03:25:20 +00:00
child.active = false;
}
}
2023-01-11 10:09:18 +00:00
this.speciesName = speciesName;
2023-01-13 03:25:20 +00:00
this.effAnimNode = this.animNode.getChildByName(this.speciesName);
2023-01-11 10:09:18 +00:00
this.effAnimNode.active = true;
},
2023-01-11 14:24:31 +00:00
onLoad() {},
2023-01-11 10:09:18 +00:00
});