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.
44 lines
1.0 KiB
44 lines
1.0 KiB
import HeadIconScipt from "./HeadIconScipt2";
|
|
import MoveTouchScript from "./MoveTouchScript2";
|
|
|
|
|
|
const {ccclass, property} = cc._decorator;
|
|
|
|
@ccclass
|
|
export default class HeadNodeList extends cc.Component {
|
|
|
|
@property(cc.Node)
|
|
headNode: cc.Node = null;
|
|
|
|
@property(cc.Node)
|
|
headNodeContent: cc.Node = null;
|
|
|
|
|
|
|
|
|
|
// LIFE-CYCLE CALLBACKS:
|
|
|
|
// onLoad () {}
|
|
|
|
start () {
|
|
|
|
}
|
|
|
|
setHeadData(headListData, checkNodelist, targetList){
|
|
for(let i = 0;i<headListData.length;i++){
|
|
let data_ = headListData[i]
|
|
let headNode = cc.instantiate(this.headNode)
|
|
headNode.active = true
|
|
this.headNodeContent.addChild(headNode)
|
|
headNode.setPosition(cc.v2(0,0))
|
|
|
|
let scr:HeadIconScipt = headNode.getComponent(HeadIconScipt)
|
|
scr.setHeadIconData(data_)
|
|
|
|
|
|
let moveScr:MoveTouchScript = headNode.getChildByName('icon').getComponent(MoveTouchScript)
|
|
moveScr.setTouchNode(checkNodelist.children[i], targetList[i])
|
|
}
|
|
}
|
|
// update (dt) {}
|
|
}
|
|
|