Jelajahi Sumber

lvl2 颜色微调

woso_javan 4 bulan lalu
induk
melakukan
f5c6c7f0cb

+ 5 - 5
assets/module_movecar/Prefabs/CarColorsLevels/lvl_2.prefab

@@ -4398,7 +4398,7 @@
     "propertyPath": [
       "_carColor"
     ],
-    "value": 3
+    "value": 7
   },
   {
     "__type__": "cc.TargetInfo",
@@ -6360,7 +6360,7 @@
     "propertyPath": [
       "_carColor"
     ],
-    "value": 5
+    "value": 4
   },
   {
     "__type__": "CCPropertyOverrideInfo",
@@ -8309,7 +8309,7 @@
     "propertyPath": [
       "_carColor"
     ],
-    "value": 1
+    "value": 8
   },
   {
     "__type__": "cc.TargetInfo",
@@ -9261,7 +9261,7 @@
     "propertyPath": [
       "_carColor"
     ],
-    "value": 2
+    "value": 7
   },
   {
     "__type__": "CCPropertyOverrideInfo",
@@ -12902,7 +12902,7 @@
     "propertyPath": [
       "_carColor"
     ],
-    "value": 2
+    "value": 7
   },
   {
     "__type__": "cc.TargetInfo",

+ 1 - 1
assets/module_movecar/RoosterMoveCar.ts

@@ -38,7 +38,7 @@ export class RoosterMoveCar extends Component {
 
     async startGame() {
         //DOTO 获取保存等级
-        LevelManager.instance.levelModel.level = 3;
+        LevelManager.instance.levelModel.level = 2;
         await LevelManager.instance.gameStart();
     }
 

+ 1 - 1
assets/module_movecar/Script/Components/PinComponent.ts

@@ -95,7 +95,7 @@ export class PinComponent extends Component {
         // 获取当前层以上的所有 layer
         const higherLayers = this.getHigherLayers(currentLayer);
         if (higherLayers.length === 0) {
-            this.isBlocked = false; // 没有上层 layer,钉子未被阻挡
+            // this.isBlocked = false; // 没有上层 layer,钉子未被阻挡
             return;
         }
 

+ 3 - 0
assets/module_movecar/Script/Enum/GameEvent.ts

@@ -10,6 +10,9 @@ export class GameEvent {
     /** 更新Layer*/
     static readonly EVENT_UPDATE_LAYER = 'EVENT_UPDATE_LAYER';
 
+    /** 检查Layer子节点*/
+    static readonly EVENT_CHECK_LAYER_CHILD = 'EVENT_CHECK_LAYER_CHILD';
+
     /** 刷新剩余钉子数量*/
     static readonly EVENT_UPDATE_LEFT_NAIL = 'EVENT_UPDATE_LEFT_NAIL';
 

+ 15 - 0
assets/module_movecar/Script/UnitAction.ts

@@ -2,12 +2,27 @@ import { _decorator, Component } from 'cc';
 import { CarColors } from './CarColorsGlobalTypes';
 import { PinComponent } from './Components/PinComponent';
 import { LayerAction } from './LayerAction';
+import { EventDispatcher } from '../../core_tgx/easy_ui_framework/EventDispatcher';
+import { GameEvent } from './Enum/GameEvent';
 const { ccclass, property } = _decorator;
 
 @ccclass('UnitAction')
 export class UnitAction extends Component {
     start() {
+        EventDispatcher.instance.on(GameEvent.EVENT_UPDATE_LAYER, this.onCheckLayerChild, this);
+    }
+
+    onCheckLayerChild() {
+        if (!this.node) return
 
+        this.node.children.forEach(layer_node => {
+            const layer_action = layer_node.getComponent(LayerAction)!;
+            if (layer_action.node.children.length <= 0) {
+                console.log('删除一个Layer层 没有element元素了---->')
+                layer_action.node.removeFromParent();
+                layer_action.node.destroy();
+            }
+        });
     }
 
     update(deltaTime: number) {