重做 局内经验的利用,加攻 加血,特殊技能,todo:先完成物品设定
This commit is contained in:
30
assets/script/game/map/Item.ts
Normal file
30
assets/script/game/map/Item.ts
Normal file
@@ -0,0 +1,30 @@
|
||||
import { instantiate, Prefab } from "cc";
|
||||
import { ecs } from "../../../../extensions/oops-plugin-framework/assets/libs/ecs/ECS";
|
||||
import { oops } from "../../../../extensions/oops-plugin-framework/assets/core/Oops";
|
||||
import { ItemComp } from "./ItemComp";
|
||||
|
||||
/** Item 模块 */
|
||||
@ecs.register(`Item`)
|
||||
export class Item extends ecs.Entity {
|
||||
|
||||
protected init() {
|
||||
// this.addComponents<ecs.Comp>();
|
||||
}
|
||||
load(uuid:number=1001,num:number=0,praent:any=null) {
|
||||
var path = "game/gui/item";
|
||||
var prefab: Prefab = oops.res.get(path, Prefab)!;
|
||||
var node = instantiate(prefab);
|
||||
node.parent = praent
|
||||
let iv = node.getComponent(ItemComp)!;
|
||||
iv.i_uuid = uuid
|
||||
iv.num=num
|
||||
this.add(iv)
|
||||
}
|
||||
/** 模块资源释放 */
|
||||
destroy() {
|
||||
|
||||
super.destroy();
|
||||
}
|
||||
}
|
||||
|
||||
/** Item 模块业务逻辑系统组件,如无业务逻辑处理可删除此对象 */
|
||||
Reference in New Issue
Block a user