消消方块阵换皮表情
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.
 
 
 

27 lines
641 B

import { _decorator, Component, Node } from 'cc';
const { ccclass, property } = _decorator;
@ccclass('SkillLayerTop')
export class SkillLayerTop extends Component {
onEnable() {
this.node.on(Node.EventType.CHILD_ADDED, this.onChildAdded, this);
}
protected onDisable(): void {
this.node.off(Node.EventType.CHILD_ADDED, this.onChildAdded, this);
}
onChildAdded(child: Node) {
//console.log("onChildAdded", child.name)
let index = this.node.children.findIndex((item) => item.name == child.name)
if (index != -1) {
child.setSiblingIndex(index);
}
}
}