完成奖品和物品显示,使用oops.gui.open打开物品信息栏 可能还存在问题
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { EventTouch, Node,_decorator } from "cc";
|
||||
import { EventTouch, Label, Node,_decorator } 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 { oops } from "../../../../extensions/oops-plugin-framework/assets/core/Oops";
|
||||
@@ -10,20 +10,15 @@ const { ccclass, property } = _decorator;
|
||||
@ecs.register('ItemInfo', false)
|
||||
export class ItemInfoComp extends CCComp {
|
||||
onAdded(args: any) {
|
||||
console.log("args");
|
||||
}
|
||||
|
||||
onLoad() {
|
||||
this.node.on(Node.EventType.TOUCH_END, this.onTouchEnd, this);
|
||||
console.log("args",args);
|
||||
this.node.getChildByName("name").getComponent(Label).string=args.name
|
||||
this.node.getChildByName("info").getComponent(Label).string=args.info
|
||||
}
|
||||
|
||||
private onTouchEnd(event: EventTouch) {
|
||||
switch (event.target.name) {
|
||||
case "btn_levelup":
|
||||
this.ent.remove(ItemInfoComp);
|
||||
break;
|
||||
case "btn_close":
|
||||
this.ent.remove(ItemInfoComp);
|
||||
case "btn":
|
||||
this.reset();
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -33,10 +28,10 @@ export class ItemInfoComp extends CCComp {
|
||||
reset() {
|
||||
oops.gui.remove(UIID.ItemInfo, false);
|
||||
|
||||
// 注:模拟二次删除清理缓存
|
||||
setTimeout(() => {
|
||||
oops.gui.remove(UIID.ItemInfo);
|
||||
}, 1000);
|
||||
// // 注:模拟二次删除清理缓存
|
||||
// setTimeout(() => {
|
||||
// oops.gui.remove(UIID.ItemInfo);
|
||||
// }, 100);
|
||||
}
|
||||
|
||||
protected onDestroy(): void {
|
||||
|
||||
Reference in New Issue
Block a user