接下来 优化技能
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user