卡牌技能
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import { oops } from "../../../../extensions/oops-plugin-framework/assets/core/Oops";
|
||||
import { ecs } from "../../../../extensions/oops-plugin-framework/assets/libs/ecs/ECS";
|
||||
import { BoxSet } from "../common/config/BoxSet";
|
||||
import { smc } from "../common/SingletonModuleComp";
|
||||
import { SkillCom } from "./SkillCom";
|
||||
import { instantiate, Node, Prefab, Vec3 ,tween, v3,animation,Label,resources,SpriteFrame,Sprite} from "cc";
|
||||
|
||||
@@ -33,8 +34,9 @@ export class Skill extends ecs.Entity {
|
||||
var node = instantiate(prefab);
|
||||
node.parent = parent;
|
||||
node.setScale(scale,1)
|
||||
//转换pos为世界坐标
|
||||
node.setPosition(pos)
|
||||
|
||||
|
||||
var sv = node.getComponent(SkillCom)!;
|
||||
sv.speed = speed;
|
||||
sv.range = range;
|
||||
|
||||
@@ -2,6 +2,7 @@ import { _decorator,Collider2D ,Contact2DType,v3,IPhysics2DContact} from "cc";
|
||||
import { ecs } from "../../../../extensions/oops-plugin-framework/assets/libs/ecs/ECS";
|
||||
import { CCComp } from "../../../../extensions/oops-plugin-framework/assets/module/common/CCComp";
|
||||
import { BoxSet } from "../common/config/BoxSet";
|
||||
import { smc } from "../common/SingletonModuleComp";
|
||||
|
||||
const { ccclass, property } = _decorator;
|
||||
|
||||
@@ -88,10 +89,16 @@ export class SkillCom extends CCComp {
|
||||
// }
|
||||
// }
|
||||
toDestroy() {
|
||||
// this.node.active = false;
|
||||
var scene = smc.map.MapView.scene;
|
||||
this.node.parent = scene.entityLayer!.node!;
|
||||
// console.log("toDestroy");
|
||||
if (this.node.isValid) {
|
||||
// console.log("this.node.isValid");
|
||||
setTimeout(() => {
|
||||
// console.log("SkillCom.node.destroy",this);
|
||||
this.ent.destroy()
|
||||
}, 15);
|
||||
}, 10);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user