Browse Source

界面适配调整

kaka 4 năm trước cách đây
mục cha
commit
1dd7c13db6

+ 41 - 8
assets/resources/game/prefab/uiPanel/PlantPanel.prefab

@@ -24,9 +24,6 @@
     "_active": true,
     "_components": [
       {
-        "__id__": 17
-      },
-      {
         "__id__": 18
       },
       {
@@ -34,10 +31,13 @@
       },
       {
         "__id__": 20
+      },
+      {
+        "__id__": 21
       }
     ],
     "_prefab": {
-      "__id__": 21
+      "__id__": 22
     },
     "_opacity": 255,
     "_color": {
@@ -105,10 +105,13 @@
     "_components": [
       {
         "__id__": 15
+      },
+      {
+        "__id__": 16
       }
     ],
     "_prefab": {
-      "__id__": 16
+      "__id__": 17
     },
     "_opacity": 255,
     "_color": {
@@ -120,7 +123,7 @@
     },
     "_contentSize": {
       "__type__": "cc.Size",
-      "width": 750,
+      "width": 750.0000000000001,
       "height": 500
     },
     "_anchorPoint": {
@@ -132,8 +135,8 @@
       "__type__": "TypedArray",
       "ctor": "Float64Array",
       "array": [
-        0,
-        -667,
+        981.4070000000002,
+        -175.98299999999995,
         0,
         0,
         0,
@@ -596,6 +599,33 @@
     "_id": ""
   },
   {
+    "__type__": "cc.Widget",
+    "_name": "",
+    "_objFlags": 0,
+    "node": {
+      "__id__": 2
+    },
+    "_enabled": true,
+    "alignMode": 1,
+    "_target": null,
+    "_alignFlags": 44,
+    "_left": 981.407,
+    "_right": -981.407,
+    "_top": 0,
+    "_bottom": -8.983000000000004,
+    "_verticalCenter": 0,
+    "_horizontalCenter": 0,
+    "_isAbsLeft": true,
+    "_isAbsRight": true,
+    "_isAbsTop": true,
+    "_isAbsBottom": true,
+    "_isAbsHorizontalCenter": true,
+    "_isAbsVerticalCenter": true,
+    "_originalWidth": 750,
+    "_originalHeight": 0,
+    "_id": ""
+  },
+  {
     "__type__": "cc.PrefabInfo",
     "root": {
       "__id__": 1
@@ -645,8 +675,11 @@
       "__id__": 2
     },
     "open_effect": 5,
+    "isOpenCloseEffect": true,
     "close_effect": 5,
     "close_toPoint": "",
+    "close_uibg": false,
+    "isDelayOneFrame": true,
     "_id": ""
   },
   {

+ 5 - 3
assets/script/before/view/uiItem/PlantItem.ts

@@ -49,9 +49,11 @@ export default class PlantItem extends cc.Component {
         }
 
         this.maskNode.active = !unlock;
-        let des = this.getDesByType();
-        let plantName = gData.gameData.getProductMap(this.data.picture - 1).name;
-        this.labUnlock.string = `${des}${this.data.value}次${plantName}\n即可解锁`;
+        if (!unlock) {
+            let des = this.getDesByType();
+            let plantName = gData.gameData.getProductMap(this.data.picture - 1).name;
+            this.labUnlock.string = `${des}${this.data.value}次${plantName}\n即可解锁`;
+        }
     }
 
     clickMake() {

+ 14 - 17
assets/script/game/component/tween/EffectOpenAndClose.ts

@@ -26,7 +26,7 @@ export default class EffectOpenAndClose extends cc.Component {
     @property({ type: cc.Enum(EffectType), displayName: '打开动画节点效果', visible() { return this.effect_par } })
     private open_effect: EffectType = EffectType.scale;
 
-    @property({displayName: '是否打开关闭动画'})
+    @property({ displayName: '是否打开关闭动画' })
     private isOpenCloseEffect: boolean = true;
     @property({ type: cc.Enum(EffectType), displayName: '关闭动画节点效果', visible() { return this.effect_par && this.isOpenCloseEffect } })
     private close_effect: EffectType = EffectType.scale;
@@ -34,10 +34,10 @@ export default class EffectOpenAndClose extends cc.Component {
     @property({ displayName: '关闭节点缩小到此节点坐标', visible() { return this.close_effect == EffectType.scaleToPoint } })
     private close_toPoint: string = "";
 
-    @property({displayName: '做关闭动画之前是否关闭黑背景'})
+    @property({ displayName: '做关闭动画之前是否关闭黑背景' })
     private close_uibg: boolean = false;
 
-    @property({displayName: '是否延迟一帧做动画'})
+    @property({ displayName: '是否延迟一帧做动画' })
     private isDelayOneFrame: boolean = false;
 
     private _play_open: boolean = false;
@@ -72,23 +72,22 @@ export default class EffectOpenAndClose extends cc.Component {
 
     start() {
         if (CC_EDITOR) return;
-        if(this.isDelayOneFrame)
-        {
-            cc.tween(this.effect_par).delay(0.16).call(()=>{
+        if (this.isDelayOneFrame) {
+            cc.tween(this.effect_par).delay(0.16).call(() => {
                 this.showEffect();
             }).start();
-        }else{
+        } else {
             this.showEffect();
         }
-        
-        
+
+
     }
 
     /**
      * 界面打开效果
      */
     private showEffect() {
-        
+
         if (this.effect_par) {
             switch (this.open_effect) {
                 case EffectType.none:
@@ -109,7 +108,7 @@ export default class EffectOpenAndClose extends cc.Component {
                 case EffectType.bottomIn:
                     this.effect_par.active = true;
                     this.effect_par.x = 0;
-                    this.effect_par.y = this.effect_par.y -cc.winSize.height;
+                    this.effect_par.y = this.effect_par.y - cc.winSize.height;
                     //let toY = this.effect_par.y + this.effect_par.height;
                     let toY = 0;
                     cc.tween(this.effect_par)
@@ -126,20 +125,18 @@ export default class EffectOpenAndClose extends cc.Component {
      */
     public hideEffect(cb?: Function) {
 
-        if(!this.isOpenCloseEffect)
+        if (!this.isOpenCloseEffect)
             return;
 
         if (this.effect_par) {
 
-            if(this.close_uibg)
-            {
+            if (this.close_uibg) {
                 let graph = this.node.getComponentInChildren(cc.Graphics);
-                if(graph)
-                {
+                if (graph) {
                     graph.enabled = false;
                 }
             }
-            
+
             switch (this.close_effect) {
                 case EffectType.none:
                     cb && cb();