薛鸿潇 пре 5 година
родитељ
комит
cc05e070ff

+ 6 - 6
assets/resources/module/reward/rewardMission.prefab

@@ -454,8 +454,8 @@
     },
     },
     "_contentSize": {
     "_contentSize": {
       "__type__": "cc.Size",
       "__type__": "cc.Size",
-      "width": 58,
-      "height": 39.8
+      "width": 60,
+      "height": 41.8
     },
     },
     "_anchorPoint": {
     "_anchorPoint": {
       "__type__": "cc.Vec2",
       "__type__": "cc.Vec2",
@@ -536,12 +536,12 @@
     "_enabled": true,
     "_enabled": true,
     "_color": {
     "_color": {
       "__type__": "cc.Color",
       "__type__": "cc.Color",
-      "r": 39,
+      "r": 207,
       "g": 110,
       "g": 110,
-      "b": 186,
+      "b": 3,
       "a": 255
       "a": 255
     },
     },
-    "_width": 1,
+    "_width": 2,
     "_id": ""
     "_id": ""
   },
   },
   {
   {
@@ -571,7 +571,7 @@
     "_srcBlendFactor": 770,
     "_srcBlendFactor": 770,
     "_dstBlendFactor": 771,
     "_dstBlendFactor": 771,
     "_spriteFrame": {
     "_spriteFrame": {
-      "__uuid__": "a833cf58-9d83-4c93-bc43-76a3a2110b3f"
+      "__uuid__": "fa82b822-09c5-49ed-ac06-d9ff17013b1f"
     },
     },
     "_type": 0,
     "_type": 0,
     "_sizeMode": 1,
     "_sizeMode": 1,

BIN
assets/resources/module/reward/texture/button1_yellow.png


+ 36 - 0
assets/resources/module/reward/texture/button1_yellow.png.meta

@@ -0,0 +1,36 @@
+{
+  "ver": "2.3.5",
+  "uuid": "6e2639a8-3c37-45af-bf85-9dab3f8bef4b",
+  "type": "sprite",
+  "wrapMode": "clamp",
+  "filterMode": "bilinear",
+  "premultiplyAlpha": false,
+  "genMipmaps": false,
+  "packable": true,
+  "width": 157,
+  "height": 83,
+  "platformSettings": {},
+  "subMetas": {
+    "button1_yellow": {
+      "ver": "1.0.4",
+      "uuid": "fa82b822-09c5-49ed-ac06-d9ff17013b1f",
+      "rawTextureUuid": "6e2639a8-3c37-45af-bf85-9dab3f8bef4b",
+      "trimType": "auto",
+      "trimThreshold": 1,
+      "rotated": false,
+      "offsetX": 0,
+      "offsetY": 0,
+      "trimX": 0,
+      "trimY": 0,
+      "width": 157,
+      "height": 83,
+      "rawWidth": 157,
+      "rawHeight": 83,
+      "borderTop": 0,
+      "borderBottom": 0,
+      "borderLeft": 0,
+      "borderRight": 0,
+      "subMetas": {}
+    }
+  }
+}

BIN
assets/resources/module/reward/texture/button2.png


+ 36 - 0
assets/resources/module/reward/texture/button2.png.meta

@@ -0,0 +1,36 @@
+{
+  "ver": "2.3.5",
+  "uuid": "6b4015e0-48f7-45a4-b368-c63d8aaa8da2",
+  "type": "sprite",
+  "wrapMode": "clamp",
+  "filterMode": "bilinear",
+  "premultiplyAlpha": false,
+  "genMipmaps": false,
+  "packable": true,
+  "width": 258,
+  "height": 109,
+  "platformSettings": {},
+  "subMetas": {
+    "button2": {
+      "ver": "1.0.4",
+      "uuid": "d7fb0625-52ac-4bc3-84c1-2a9cdb13f3ea",
+      "rawTextureUuid": "6b4015e0-48f7-45a4-b368-c63d8aaa8da2",
+      "trimType": "auto",
+      "trimThreshold": 1,
+      "rotated": false,
+      "offsetX": 0,
+      "offsetY": 0,
+      "trimX": 0,
+      "trimY": 0,
+      "width": 258,
+      "height": 109,
+      "rawWidth": 258,
+      "rawHeight": 109,
+      "borderTop": 0,
+      "borderBottom": 0,
+      "borderLeft": 0,
+      "borderRight": 0,
+      "subMetas": {}
+    }
+  }
+}

+ 46 - 0
assets/script/game/component/BangsFit.ts

@@ -0,0 +1,46 @@
+
+const {ccclass, property} = cc._decorator;
+const LeftPadding = 60;
+const RightPadding = 60;
+/**
+ * 刘海屏适配
+ * @author 薛鸿潇
+ */
+@ccclass
+export default class BangsFit extends cc.Component {
+
+    onLoad() {
+        this._AdaptLeftAndRight();
+    }
+
+    /*============================================================================================================*/
+    /**
+     */
+    /*============================================================================================================*/
+    _AdaptLeftAndRight() {
+        let widget = this.node.getComponent(cc.Widget);
+        if (!widget) return;
+
+        let is_big = this.IsBigScreenRatio();
+        if (is_big) {
+            widget.top = LeftPadding;
+            widget.bottom = RightPadding;
+        }
+    }
+
+    /**
+     * @returns 是宽屏
+     */
+    IsBigScreenRatio() {
+        return this.GetWinHeightWidthRatio() >= 1.86;
+    }
+
+    /**
+     * @returns 屏幕比率
+     */
+    GetWinHeightWidthRatio() {
+        let ratio = cc.winSize.height >= cc.winSize.width ? (cc.winSize.height / cc.winSize.width) : (cc.winSize.width / cc.winSize.height);
+
+        return ratio;
+    }
+}

+ 9 - 0
assets/script/game/component/BangsFit.ts.meta

@@ -0,0 +1,9 @@
+{
+  "ver": "1.0.8",
+  "uuid": "17386e8b-97f9-4537-a4c1-0b10e642ea82",
+  "isPlugin": false,
+  "loadPluginInWeb": true,
+  "loadPluginInNative": true,
+  "loadPluginInEditor": false,
+  "subMetas": {}
+}