You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
50 lines
1.6 KiB
50 lines
1.6 KiB
import { ryw_Event } from "../../FrameWork/Event/EventEnum";
|
|
import EventMgr from "../../FrameWork/Event/EventMgr";
|
|
import XianSuoMoveTouchScript from "./XianSuoMoveTouchScript";
|
|
|
|
const { ccclass, property } = cc._decorator;
|
|
|
|
@ccclass
|
|
export default class XianSuoIconList extends cc.Component {
|
|
|
|
@property(cc.Node)
|
|
xianSuoNode: cc.Node = null;
|
|
|
|
@property(cc.Node)
|
|
content: cc.Node = null;
|
|
|
|
start() {
|
|
this.xianSuoNode.active = false;
|
|
EventMgr.onEvent_custom(ryw_Event.XianSuoPopUpEnd, this.showXianSuoIcon, this);
|
|
}
|
|
|
|
protected onDisable(): void {
|
|
EventMgr.offEvent_custom(ryw_Event.XianSuoPopUpEnd, this.showXianSuoIcon, this);
|
|
}
|
|
|
|
setXianSuoIconList(xianSuoArray: any[]) {
|
|
for (const info of xianSuoArray) {
|
|
let xianSuoNode = cc.instantiate(this.xianSuoNode);
|
|
xianSuoNode.active = true;
|
|
this.content.addChild(xianSuoNode);
|
|
|
|
let scr: XianSuoMoveTouchScript = xianSuoNode.getComponent('XianSuoMoveTouchScript');
|
|
scr.setTouchNodeIcon(info);
|
|
}
|
|
}
|
|
|
|
showXianSuoIcon(data_) {
|
|
let touchIndex = data_.touchIndex;
|
|
let scr: XianSuoMoveTouchScript = this.content.children[touchIndex].getComponent('XianSuoMoveTouchScript')
|
|
scr.showTouchNodeIcon();
|
|
}
|
|
|
|
onXianSuoIconTouchEvent(checkNodeSet: cc.Node[]) {
|
|
for (const node of this.content.children) {
|
|
let scr: XianSuoMoveTouchScript = node.getComponent('XianSuoMoveTouchScript');
|
|
scr.onTouchEvent(checkNodeSet);
|
|
}
|
|
}
|
|
|
|
// update (dt) {}
|
|
}
|
|
|