lan 11 månader sedan
förälder
incheckning
4cd1a3748c
2 ändrade filer med 20 tillägg och 0 borttagningar
  1. 9 0
      assets/script/ui/Editor.ts
  2. 11 0
      assets/script/ui/gameMode/BaseGameUI.ts

+ 9 - 0
assets/script/ui/Editor.ts

@@ -603,6 +603,15 @@ export default class Editor extends cc.Component {
                 data.h = node.height.toFixed(1)
                 if (!sprite.trim) data.trim = sprite.trim
             }
+            if (node.scaleX != 1) {
+                data.scaleX = node.scaleX
+            }
+            if (node.scaleY != 1) {
+                data.scaleY = node.scaleY
+            }
+            if (node.color.toHEX('#rrggbb') != cc.Color.WHITE.toHEX('#rrggbb')) {
+                data.color = node.color.toHEX('#rrggbb')
+            }
             let layout = node.getComponent(cc.Layout)
             if (layout && layout.enabled) {
                 data.lay = this.cloneComponent(layout, {})

+ 11 - 0
assets/script/ui/gameMode/BaseGameUI.ts

@@ -205,6 +205,17 @@ export class BaseGameUI extends BaseUI {
                     this.loadSemeImg(PathUtils.addGP(data.tex), node, isChildSprite ? 'sprite' : '')
                 }
             }
+            if (this.teacherMode) {
+                if (data.scaleX && data.scaleX != 1) {
+                    node.scaleX = data.scaleX
+                }
+                if (data.scaleX && data.scaleY != 1) {
+                    node.scaleY = data.scaleY
+                }
+                if (data.color) {
+                    node.color = cc.Color.WHITE.fromHEX(data.color)
+                }
+            }
         }
         for (let i = allData.length; i < nodes.length; i++) {
             let node = nodes[i]