This commit is contained in:
2024-08-15 20:07:21 +08:00
parent a050207f54
commit c67a149620
10 changed files with 574 additions and 467 deletions

View File

@@ -32,7 +32,9 @@ export class Skill extends ecs.Entity {
var prefab: Prefab = oops.res.get(path, Prefab)!;
var node = instantiate(prefab);
node.parent = parent;
node.setScale(scale,1)
node.setPosition(pos)
var sv = node.getComponent(SkillCom)!;
sv.speed = speed;
sv.range = range;

View File

@@ -20,6 +20,7 @@ export class SkillCom extends CCComp {
atk:number = 10;
is_destroy:boolean = false;
start() {
this.node.active=true
let collider = this.getComponent(Collider2D);
if (collider) {
// collider.on(Contact2DType.BEGIN_CONTACT, this.onBeginContact, this);