import { instantiate, Label, Prefab, resources, Sprite, SpriteAtlas, Vec3 } 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"; import { Items } from "../common/config/Items"; /** Item 模块 */ @ecs.register(`Item`) export class Item extends ecs.Entity { protected init() { // this.addComponents(); } 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 iv.update_data(uuid,num) this.add(iv) } /** 模块资源释放 */ destroy() { super.destroy(); } } /** Item 模块业务逻辑系统组件,如无业务逻辑处理可删除此对象 */