42 lines
1.4 KiB
TypeScript
42 lines
1.4 KiB
TypeScript
import { _decorator, Component, instantiate, Node, Prefab } from 'cc';
|
|
import { SkillCom } from './SkillCom';
|
|
import { ecs } from 'db://oops-framework/libs/ecs/ECS';
|
|
import { Hero } from '../hero/Hero';
|
|
import { BoxSet } from '../common/config/BoxSet';
|
|
import { Monster } from '../hero/Mon';
|
|
import { HeroViewComp } from '../hero/HeroViewComp';
|
|
import { smc } from '../common/SingletonModuleComp';
|
|
import { HeroInfo } from '../common/config/heroSet';
|
|
import { oops } from 'db://oops-framework/core/Oops';
|
|
const { ccclass, property } = _decorator;
|
|
//这是召唤技能
|
|
@ccclass('ZhanCom')
|
|
export class ZhanCom extends Component {
|
|
base:SkillCom = null
|
|
start() {
|
|
console.log("ZhanCom:",this.base)
|
|
this.base =this.node.getComponent(SkillCom)
|
|
let pos = this.node.position
|
|
let hero:any=null
|
|
var path = "game/skills/dead";
|
|
var prefab: Prefab = oops.res.get(path, Prefab)!;
|
|
var node = instantiate(prefab);
|
|
node.parent = this.node.parent;
|
|
node.setPosition(pos);
|
|
if(this.base.box_group==BoxSet.HERO) {
|
|
hero = ecs.getEntity<Hero>(Hero);
|
|
let scale = 1
|
|
hero.load(pos,scale,this.base.hero,true,this.base.lv);
|
|
}
|
|
if(this.base.box_group==BoxSet.MONSTER) {
|
|
hero = ecs.getEntity<Monster>(Monster);
|
|
}
|
|
}
|
|
|
|
update(deltaTime: number) {
|
|
|
|
}
|
|
|
|
|
|
|
|
} |