接下来 优化技能

This commit is contained in:
2024-09-13 10:41:38 +08:00
parent c8fe4a6ebe
commit 489b045982
40 changed files with 2010 additions and 22670 deletions

View File

@@ -38,8 +38,8 @@ export class Skill extends ecs.Entity {
var prefab: Prefab = oops.res.get(path, Prefab)!;
var node = instantiate(prefab);
// console.log("load skill parent.position :",parent.position)
pos=v3(parent.position.x+pos.x,parent.position.y+pos.y)
node.parent = parent.parent;
pos=v3(pos.x,pos.y)
node.parent = parent;
node.setScale(scale,1)
//转换pos为世界坐标
node.setPosition(pos)

View File

@@ -175,7 +175,7 @@ export class SkillCom extends CCComp {
toDestroy() {
if(this.is_destroy){
if(this.node.isValid) this.ent.destroy()
if(this.node.parent) this.ent.destroy()
}
}