2023-01-15 05:11:19 +00:00
|
|
|
const Bullet = require("./Bullet");
|
2023-01-11 10:09:18 +00:00
|
|
|
|
2023-01-15 05:11:19 +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.children[k];
|
|
|
|
if (!child.active) continue;
|
|
|
|
if (child == effAnimNode || child.name == speciesName) continue;
|
|
|
|
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
|
|
|
});
|