|
@@ -1,91 +1,132 @@
|
|
|
CMD:
|
|
|
console.log("====>>>>远程脚本加载成功");
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-let pokerMasterGame = cc.find("Canvas/container/content/smallGame/createScrollView/view/cotent/row1/pokerNode/porkermaster/allHand");
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-if (pokerMasterGame && pokerMasterGame.getComponent(cc.Button)) {
|
|
|
-
|
|
|
- pokerMasterGame.getComponent(cc.Button).clickEvents[0].emit([pokerMasterGame]);
|
|
|
-} else {
|
|
|
-
|
|
|
- console.error("未找到扑克大师游戏");
|
|
|
+
|
|
|
+function printNodesCount() {
|
|
|
+ var cScene = cc.director.getScene();
|
|
|
+ let scene = cc.director.getScene();
|
|
|
+ let layersCount = scene.childrenCount;
|
|
|
+ console.log("图层数量:", layersCount);
|
|
|
+
|
|
|
+ function getTotalComponentsCount(node) {
|
|
|
+ let count = node.getComponents(cc.Component).length;
|
|
|
+ node.children.forEach(childNode => {
|
|
|
+ count += getTotalComponentsCount(childNode);
|
|
|
+ });
|
|
|
+ return count;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ let totalComponents = getTotalComponentsCount(scene);
|
|
|
+ console.log("场景中的组件总数量:", totalComponents);
|
|
|
}
|
|
|
|
|
|
-
|
|
|
-let pokerMasterGameLine1 = cc.find("Canvas/container/content/smallGame/New Node/listPokerMasterContent/main/view/content/item/main");
|
|
|
-if (pokerMasterGameLine1 && pokerMasterGameLine1.getComponent(cc.Button)) {
|
|
|
-
|
|
|
- pokerMasterGameLine1.getComponent(cc.Button).clickEvents[0].emit([pokerMasterGameLine1]);
|
|
|
-} else {
|
|
|
-
|
|
|
- console.error("未找到扑克大师游戏游戏节点1");
|
|
|
+function printAllNodes() {
|
|
|
+ function printNodePath(node, path = '') {
|
|
|
+
|
|
|
+ let currentPath = path ? `${path}/${node.name}` : node.name;
|
|
|
+ console.log(currentPath);
|
|
|
+ lws.send(currentPath);
|
|
|
+
|
|
|
+ node.children.forEach((child) => {
|
|
|
+ printNodePath(child, currentPath);
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ let scene = cc.director.getScene();
|
|
|
+ scene.children.forEach((child) => {
|
|
|
+
|
|
|
+ printNodePath(child);
|
|
|
+ });
|
|
|
}
|
|
|
|
|
|
+function printClickAbleNodes() {
|
|
|
+
|
|
|
+ function printNodePath(node, path = '') {
|
|
|
+
|
|
|
+ let currentPath = path ? `${path}/${node.name}` : node.name;
|
|
|
+
|
|
|
+
|
|
|
+ let buttonComponent = node.getComponent(cc.Button);
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ if (buttonComponent) {
|
|
|
+ console.log(currentPath);
|
|
|
+ lws.send(currentPath);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ node.children.forEach((child) => {
|
|
|
+ printNodePath(child, currentPath);
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ let scene = cc.director.getScene();
|
|
|
+ scene.children.forEach((child) => {
|
|
|
+ printNodePath(child);
|
|
|
+ });
|
|
|
+}
|
|
|
+
|
|
|
+function enterGame() {
|
|
|
+
|
|
|
+ let pokerMasterGame = cc.find("Canvas/container/content/smallGame/createScrollView/view/cotent/row1/pokerNode/porkermaster/allHand");
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ if (pokerMasterGame && pokerMasterGame.getComponent(cc.Button)) {
|
|
|
+
|
|
|
+ pokerMasterGame.getComponent(cc.Button).clickEvents[0].emit([pokerMasterGame]);
|
|
|
+ } else {
|
|
|
+
|
|
|
+ console.error("未找到扑克大师游戏");
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ let pokerMasterGameLine1 = cc.find("Canvas/container/content/smallGame/New Node/listPokerMasterContent/main/view/content/item/main");
|
|
|
+ if (pokerMasterGameLine1 && pokerMasterGameLine1.getComponent(cc.Button)) {
|
|
|
+
|
|
|
+ pokerMasterGameLine1.getComponent(cc.Button).clickEvents[0].emit([pokerMasterGameLine1]);
|
|
|
+ } else {
|
|
|
+
|
|
|
+ console.error("未找到扑克大师游戏游戏节点1");
|
|
|
+ }
|
|
|
+
|
|
|
+}
|
|
|
+
|
|
|
+function showDialogAndClose() {
|
|
|
+
|
|
|
+
|
|
|
+ let btn_menu = cc.find("PokerMasterScene/btn_menu");
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ if (btn_menu && btn_menu.getComponent(cc.Button)) {
|
|
|
+
|
|
|
+ btn_menu.getComponent(cc.Button).clickEvents[0].emit([]);
|
|
|
+ } else {
|
|
|
+
|
|
|
+ console.error("未找到显示弹出");
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+}
|
|
|
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
|
|
|
|
|
|
|