瀏覽代碼

修改关卡调整 fixed 刷新颜色bug

woso_javan 4 月之前
父節點
當前提交
66e0007d07

+ 3 - 3
assets/module_movecar/Prefabs/CarColorsLevels/lvl_3.prefab

@@ -3619,9 +3619,9 @@
     ],
     "value": {
       "__type__": "cc.Vec3",
-      "x": 180,
-      "y": 180,
-      "z": 7.016709298534876e-15
+      "x": 0,
+      "y": 0,
+      "z": 180
     }
   },
   {

+ 9 - 9
assets/module_movecar/Prefabs/CarColorsLevels/lvl_5.prefab

@@ -16544,9 +16544,9 @@
     ],
     "value": {
       "__type__": "cc.Vec3",
-      "x": 180,
-      "y": 180,
-      "z": 7.016709298534876e-15
+      "x": 0,
+      "y": 0,
+      "z": 180
     }
   },
   {
@@ -17621,9 +17621,9 @@
     ],
     "value": {
       "__type__": "cc.Vec3",
-      "x": 180,
-      "y": 180,
-      "z": 7.016709298534876e-15
+      "x": 0,
+      "y": 0,
+      "z": 180
     }
   },
   {
@@ -18663,9 +18663,9 @@
     ],
     "value": {
       "__type__": "cc.Vec3",
-      "x": 180,
-      "y": 180,
-      "z": 7.016709298534876e-15
+      "x": 0,
+      "y": 0,
+      "z": 180
     }
   },
   {

+ 13 - 13
assets/module_movecar/Script/Systems/CarCarColorsSysterm.ts

@@ -215,19 +215,19 @@ export class CarCarColorsSysterm extends Component {
         });
 
         // 检查可开出的车中是否至少有一个车的颜色是待解锁的钉子颜色之一
-        let hasValidColor = false;
-        canOutCar.forEach(car => {
-            if (topPins.has(car.carColor)) {
-                hasValidColor = true;
-            }
-        });
-
-        if (!hasValidColor && canOutCar.length > 0) {
-            // 如果没有符合条件的车,将第一个可开出的车的颜色改为待解锁的钉子颜色之一
-            const firstCar = canOutCar[0];
-            const newColor = Array.from(topPins)[0]; // 取第一个待解锁的颜色
-            firstCar.carColor = newColor;
-        }
+        // let hasValidColor = false;
+        // canOutCar.forEach(car => {
+        //     if (topPins.has(car.carColor)) {
+        //         hasValidColor = true;
+        //     }
+        // });
+
+        // if (!hasValidColor && canOutCar.length > 0) {
+        //     // 如果没有符合条件的车,将第一个可开出的车的颜色改为待解锁的钉子颜色之一
+        //     const firstCar = canOutCar[0];
+        //     const newColor = Array.from(topPins)[0]; // 取第一个待解锁的颜色
+        //     firstCar.carColor = newColor;
+        // }
     }
 
     checkCarBox() {

+ 5 - 1
assets/module_movecar/Script/Systems/UnitColorsSysterm.ts

@@ -8,7 +8,7 @@ import { EventDispatcher } from "db://assets/core_tgx/easy_ui_framework/EventDis
 import { GameEvent } from "../Enum/GameEvent";
 import { LevelAction } from "../LevelAction";
 import { LayerAction } from "../LayerAction";
-import { CarColors } from "../CarColorsGlobalTypes";
+import { CarColorLog, CarColors } from "../CarColorsGlobalTypes";
 const { ccclass, property } = _decorator;
 
 @ccclass('UnitColorsSysterm')
@@ -79,6 +79,10 @@ export class UnitColorsSysterm extends Component {
     }
 
     moveToCar() {
+        const carColor = this.selectedCar.getComponent(CarCarColorsComponent).carColor
+        const pinColor = this.findPins[0].getComponent(PinComponent).pin_color
+        console.log(`上车的颜色${CarColorLog[carColor]} 上车数量:${this.findPins.length}上车的螺丝颜色:${CarColorLog[pinColor]}`);
+
         if (this.selectedCar != null) {
             this.findPins.forEach(pin => {
                 this.selectedCar.getComponent(CarCarColorsComponent).addRole(pin);