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) {
|
2023-02-17 07:38:37 +00:00
|
|
|
const child = this.animNode.children[k];
|
2023-01-13 03:25:20 +00:00
|
|
|
if (!child.active) continue;
|
2023-02-17 07:38:37 +00:00
|
|
|
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
|
|
|
});
|