Răsfoiți Sursa

只显示一次

woso_javan 4 luni în urmă
părinte
comite
400afd4548

+ 2 - 5
assets/module_movecar/Script/LayerAction.ts

@@ -69,7 +69,7 @@ export class LayerAction extends Component {
                         element_node.getComponent(ElementAction)?.flash_img();
                     });
                 }
-
+                console.log('显示layer+++++++++++++')
                 break;
             case 2:
                 if (this.layer_status != 2) {
@@ -78,10 +78,7 @@ export class LayerAction extends Component {
                     });
                     this.scheduleOnce(() => {
                         this.node.active = true;
-                        this.node.children.forEach(element_node => {
-                            element_node.getComponent(ElementAction)?.flash_img(0.5);
-                        });
-                    }, 1.6);
+                    }, 1);
                 }
                 break;
         }

+ 7 - 4
assets/module_movecar/Script/LevelAction.ts

@@ -123,9 +123,13 @@ export class LevelAction extends Component {
             }
             show_num++;
             if (show_num <= default_show_layer_num) {
-                layer_action.set_status(1);
+                if (layer_action.layer_status != 1) {
+                    layer_action.set_status(1);
+                }
             } else if (show_num == (default_show_layer_num + 1)) {
-                layer_action.set_status(2);
+                if (layer_action.layer_status != 2) {
+                    layer_action.set_status(2);
+                }
             } else {
                 layer_action.set_status(0);
             }
@@ -324,9 +328,8 @@ export class LevelAction extends Component {
             }
         };
 
-        // 取消之前的检测,重新调度
         this.unschedule(checkOver);
-        this.scheduleOnce(checkOver, 2); // 2 秒后检测
+        this.scheduleOnce(checkOver, 2);
     }
 
     protected onDestroy(): void {