diff --git a/assets/prefabs/PageLevel.prefab b/assets/prefabs/PageLevel.prefab index 5e4eff8..3acd3d9 100644 --- a/assets/prefabs/PageLevel.prefab +++ b/assets/prefabs/PageLevel.prefab @@ -34,29 +34,29 @@ "__id__": 56 }, { - "__id__": 98 + "__id__": 102 }, { - "__id__": 224 + "__id__": 228 } ], "_active": true, "_components": [ { - "__id__": 244 + "__id__": 254 }, { - "__id__": 246 + "__id__": 256 }, { - "__id__": 248 + "__id__": 258 }, { - "__id__": 252 + "__id__": 262 } ], "_prefab": { - "__id__": 254 + "__id__": 264 }, "_lpos": { "__type__": "cc.Vec3", @@ -274,7 +274,7 @@ "_lpos": { "__type__": "cc.Vec3", "x": -420.451, - "y": 927.29, + "y": 955.309, "z": 0 }, "_lrot": { @@ -389,7 +389,7 @@ "_target": null, "_left": 65.54899999999998, "_right": 0, - "_top": 98.71000000000004, + "_top": 70.69100000000003, "_bottom": 0, "_horizontalCenter": 0, "_verticalCenter": 0, @@ -509,7 +509,7 @@ "_lpos": { "__type__": "cc.Vec3", "x": -255.44, - "y": 927.652, + "y": 955.671, "z": 0 }, "_lrot": { @@ -874,7 +874,7 @@ "_target": null, "_left": 234.56, "_right": 0, - "_top": 102.34799999999996, + "_top": 74.32899999999995, "_bottom": 0, "_horizontalCenter": 0, "_verticalCenter": 0, @@ -938,7 +938,7 @@ "_lpos": { "__type__": "cc.Vec3", "x": 378.58, - "y": 932.298, + "y": 960.317, "z": 0 }, "_lrot": { @@ -1303,7 +1303,7 @@ "_target": null, "_left": 0, "_right": 111.42000000000002, - "_top": 97.702, + "_top": 69.68299999999999, "_bottom": 0, "_horizontalCenter": 0, "_verticalCenter": 0, @@ -1355,14 +1355,17 @@ "_active": true, "_components": [ { - "__id__": 93 + "__id__": 95 }, { - "__id__": 95 + "__id__": 97 + }, + { + "__id__": 99 } ], "_prefab": { - "__id__": 97 + "__id__": 101 }, "_lpos": { "__type__": "cc.Vec3", @@ -1551,14 +1554,14 @@ "_active": true, "_components": [ { - "__id__": 88 + "__id__": 90 }, { - "__id__": 90 + "__id__": 92 } ], "_prefab": { - "__id__": 92 + "__id__": 94 }, "_lpos": { "__type__": "cc.Vec3", @@ -1653,8 +1656,8 @@ }, "_contentSize": { "__type__": "cc.Size", - "width": 320, - "height": 100.8 + "width": 240, + "height": 75.6 }, "_anchorPoint": { "__type__": "cc.Vec2", @@ -1692,10 +1695,10 @@ "_string": "答案是:", "_horizontalAlign": 1, "_verticalAlign": 1, - "_actualFontSize": 80, - "_fontSize": 80, + "_actualFontSize": 60, + "_fontSize": 60, "_fontFamily": "Arial", - "_lineHeight": 80, + "_lineHeight": 60, "_overflow": 0, "_enableWrapText": true, "_font": null, @@ -1897,15 +1900,18 @@ }, { "__id__": 85 + }, + { + "__id__": 87 } ], "_prefab": { - "__id__": 87 + "__id__": 89 }, "_lpos": { "__type__": "cc.Vec3", - "x": -30, - "y": 41.081, + "x": 37.618, + "y": -0.82, "z": 0 }, "_lrot": { @@ -1995,7 +2001,7 @@ }, "_contentSize": { "__type__": "cc.Size", - "width": 160, + "width": 80, "height": 50.4 }, "_anchorPoint": { @@ -2026,12 +2032,12 @@ "_dstBlendFactor": 4, "_color": { "__type__": "cc.Color", - "r": 241, - "g": 2, - "b": 2, + "r": 255, + "g": 255, + "b": 255, "a": 255 }, - "_string": "提交答案", + "_string": "确认", "_horizontalAlign": 1, "_verticalAlign": 1, "_actualFontSize": 40, @@ -2104,8 +2110,8 @@ }, "_contentSize": { "__type__": "cc.Size", - "width": 100, - "height": 100 + "width": 200, + "height": 80 }, "_anchorPoint": { "__type__": "cc.Vec2", @@ -2174,6 +2180,51 @@ "__type__": "cc.CompPrefabInfo", "fileId": "e7TzHhWSlCHJw9Et5o0NKK" }, + { + "__type__": "cc.Sprite", + "_name": "", + "_objFlags": 0, + "__editorExtras__": {}, + "node": { + "__id__": 76 + }, + "_enabled": true, + "__prefab": { + "__id__": 88 + }, + "_customMaterial": null, + "_srcBlendFactor": 2, + "_dstBlendFactor": 4, + "_color": { + "__type__": "cc.Color", + "r": 249, + "g": 115, + "b": 22, + "a": 255 + }, + "_spriteFrame": { + "__uuid__": "7d8f9b89-4fd1-4c9f-a3ab-38ec7cded7ca@f9941", + "__expectedType__": "cc.SpriteFrame" + }, + "_type": 0, + "_fillType": 0, + "_sizeMode": 0, + "_fillCenter": { + "__type__": "cc.Vec2", + "x": 0, + "y": 0 + }, + "_fillStart": 0, + "_fillRange": 0, + "_isTrimmedMode": true, + "_useGrayscale": false, + "_atlas": null, + "_id": "" + }, + { + "__type__": "cc.CompPrefabInfo", + "fileId": "aaOqLgC4VHfLTnirVAMpWA" + }, { "__type__": "cc.PrefabInfo", "root": { @@ -2197,7 +2248,7 @@ }, "_enabled": true, "__prefab": { - "__id__": 89 + "__id__": 91 }, "_contentSize": { "__type__": "cc.Size", @@ -2225,7 +2276,7 @@ }, "_enabled": true, "__prefab": { - "__id__": 91 + "__id__": 93 }, "_resizeMode": 0, "_layoutType": 1, @@ -2276,12 +2327,12 @@ }, "_enabled": true, "__prefab": { - "__id__": 94 + "__id__": 96 }, "_contentSize": { "__type__": "cc.Size", - "width": 100, - "height": 100 + "width": 800, + "height": 1100 }, "_anchorPoint": { "__type__": "cc.Vec2", @@ -2304,13 +2355,13 @@ }, "_enabled": true, "__prefab": { - "__id__": 96 + "__id__": 98 }, "_alignFlags": 1, "_target": null, "_left": 0, "_right": 0, - "_top": 717.8009999999999, + "_top": 217.80099999999993, "_bottom": 0, "_horizontalCenter": 0, "_verticalCenter": 0, @@ -2330,6 +2381,51 @@ "__type__": "cc.CompPrefabInfo", "fileId": "bdjc5eMMRKlI7cSmDD70aq" }, + { + "__type__": "cc.Sprite", + "_name": "", + "_objFlags": 0, + "__editorExtras__": {}, + "node": { + "__id__": 56 + }, + "_enabled": true, + "__prefab": { + "__id__": 100 + }, + "_customMaterial": null, + "_srcBlendFactor": 2, + "_dstBlendFactor": 4, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_spriteFrame": { + "__uuid__": "a34c93d2-cae0-42d4-a2eb-c3155052ad20@f9941", + "__expectedType__": "cc.SpriteFrame" + }, + "_type": 0, + "_fillType": 0, + "_sizeMode": 0, + "_fillCenter": { + "__type__": "cc.Vec2", + "x": 0, + "y": 0 + }, + "_fillStart": 0, + "_fillRange": 0, + "_isTrimmedMode": true, + "_useGrayscale": false, + "_atlas": null, + "_id": "" + }, + { + "__type__": "cc.CompPrefabInfo", + "fileId": "03ptWs/+1MUruez3/FwfVN" + }, { "__type__": "cc.PrefabInfo", "root": { @@ -2353,35 +2449,35 @@ }, "_children": [ { - "__id__": 99 + "__id__": 103 }, { - "__id__": 129 + "__id__": 133 }, { - "__id__": 159 + "__id__": 163 }, { - "__id__": 189 + "__id__": 193 }, { - "__id__": 203 + "__id__": 207 } ], "_active": true, "_components": [ - { - "__id__": 217 - }, - { - "__id__": 219 - }, { "__id__": 221 + }, + { + "__id__": 223 + }, + { + "__id__": 225 } ], "_prefab": { - "__id__": 223 + "__id__": 227 }, "_lpos": { "__type__": "cc.Vec3", @@ -2418,27 +2514,27 @@ "_objFlags": 0, "__editorExtras__": {}, "_parent": { - "__id__": 98 + "__id__": 102 }, "_children": [ { - "__id__": 100 + "__id__": 104 }, { - "__id__": 106 + "__id__": 110 } ], "_active": true, "_components": [ { - "__id__": 124 + "__id__": 128 }, { - "__id__": 126 + "__id__": 130 } ], "_prefab": { - "__id__": 128 + "__id__": 132 }, "_lpos": { "__type__": "cc.Vec3", @@ -2475,20 +2571,20 @@ "_objFlags": 0, "__editorExtras__": {}, "_parent": { - "__id__": 99 + "__id__": 103 }, "_children": [], "_active": true, "_components": [ { - "__id__": 101 + "__id__": 105 }, { - "__id__": 103 + "__id__": 107 } ], "_prefab": { - "__id__": 105 + "__id__": 109 }, "_lpos": { "__type__": "cc.Vec3", @@ -2525,11 +2621,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 100 + "__id__": 104 }, "_enabled": true, "__prefab": { - "__id__": 102 + "__id__": 106 }, "_contentSize": { "__type__": "cc.Size", @@ -2553,11 +2649,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 100 + "__id__": 104 }, "_enabled": true, "__prefab": { - "__id__": 104 + "__id__": 108 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -2611,27 +2707,27 @@ "_objFlags": 0, "__editorExtras__": {}, "_parent": { - "__id__": 99 + "__id__": 103 }, "_children": [ { - "__id__": 107 + "__id__": 111 }, { - "__id__": 113 + "__id__": 117 } ], "_active": true, "_components": [ { - "__id__": 119 + "__id__": 123 }, { - "__id__": 121 + "__id__": 125 } ], "_prefab": { - "__id__": 123 + "__id__": 127 }, "_lpos": { "__type__": "cc.Vec3", @@ -2668,20 +2764,20 @@ "_objFlags": 0, "__editorExtras__": {}, "_parent": { - "__id__": 106 + "__id__": 110 }, "_children": [], "_active": true, "_components": [ { - "__id__": 108 + "__id__": 112 }, { - "__id__": 110 + "__id__": 114 } ], "_prefab": { - "__id__": 112 + "__id__": 116 }, "_lpos": { "__type__": "cc.Vec3", @@ -2718,11 +2814,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 107 + "__id__": 111 }, "_enabled": true, "__prefab": { - "__id__": 109 + "__id__": 113 }, "_contentSize": { "__type__": "cc.Size", @@ -2746,11 +2842,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 107 + "__id__": 111 }, "_enabled": true, "__prefab": { - "__id__": 111 + "__id__": 115 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -2804,20 +2900,20 @@ "_objFlags": 0, "__editorExtras__": {}, "_parent": { - "__id__": 106 + "__id__": 110 }, "_children": [], "_active": true, "_components": [ { - "__id__": 114 + "__id__": 118 }, { - "__id__": 116 + "__id__": 120 } ], "_prefab": { - "__id__": 118 + "__id__": 122 }, "_lpos": { "__type__": "cc.Vec3", @@ -2854,11 +2950,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 113 + "__id__": 117 }, "_enabled": true, "__prefab": { - "__id__": 115 + "__id__": 119 }, "_contentSize": { "__type__": "cc.Size", @@ -2882,11 +2978,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 113 + "__id__": 117 }, "_enabled": true, "__prefab": { - "__id__": 117 + "__id__": 121 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -2963,11 +3059,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 106 + "__id__": 110 }, "_enabled": true, "__prefab": { - "__id__": 120 + "__id__": 124 }, "_contentSize": { "__type__": "cc.Size", @@ -2991,11 +3087,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 106 + "__id__": 110 }, "_enabled": true, "__prefab": { - "__id__": 122 + "__id__": 126 }, "_resizeMode": 0, "_layoutType": 1, @@ -3042,11 +3138,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 99 + "__id__": 103 }, "_enabled": true, "__prefab": { - "__id__": 125 + "__id__": 129 }, "_contentSize": { "__type__": "cc.Size", @@ -3070,11 +3166,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 99 + "__id__": 103 }, "_enabled": true, "__prefab": { - "__id__": 127 + "__id__": 131 }, "clickEvents": [], "_interactable": true, @@ -3114,7 +3210,7 @@ "_duration": 0.1, "_zoomScale": 1.2, "_target": { - "__id__": 99 + "__id__": 103 }, "_id": "" }, @@ -3141,27 +3237,27 @@ "_objFlags": 0, "__editorExtras__": {}, "_parent": { - "__id__": 98 + "__id__": 102 }, "_children": [ { - "__id__": 130 + "__id__": 134 }, { - "__id__": 136 + "__id__": 140 } ], "_active": false, "_components": [ { - "__id__": 154 + "__id__": 158 }, { - "__id__": 156 + "__id__": 160 } ], "_prefab": { - "__id__": 158 + "__id__": 162 }, "_lpos": { "__type__": "cc.Vec3", @@ -3198,20 +3294,20 @@ "_objFlags": 0, "__editorExtras__": {}, "_parent": { - "__id__": 129 + "__id__": 133 }, "_children": [], "_active": true, "_components": [ { - "__id__": 131 + "__id__": 135 }, { - "__id__": 133 + "__id__": 137 } ], "_prefab": { - "__id__": 135 + "__id__": 139 }, "_lpos": { "__type__": "cc.Vec3", @@ -3248,11 +3344,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 130 + "__id__": 134 }, "_enabled": true, "__prefab": { - "__id__": 132 + "__id__": 136 }, "_contentSize": { "__type__": "cc.Size", @@ -3276,11 +3372,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 130 + "__id__": 134 }, "_enabled": true, "__prefab": { - "__id__": 134 + "__id__": 138 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -3334,27 +3430,27 @@ "_objFlags": 0, "__editorExtras__": {}, "_parent": { - "__id__": 129 + "__id__": 133 }, "_children": [ { - "__id__": 137 + "__id__": 141 }, { - "__id__": 143 + "__id__": 147 } ], "_active": true, "_components": [ { - "__id__": 149 + "__id__": 153 }, { - "__id__": 151 + "__id__": 155 } ], "_prefab": { - "__id__": 153 + "__id__": 157 }, "_lpos": { "__type__": "cc.Vec3", @@ -3391,20 +3487,20 @@ "_objFlags": 0, "__editorExtras__": {}, "_parent": { - "__id__": 136 + "__id__": 140 }, "_children": [], "_active": true, "_components": [ { - "__id__": 138 + "__id__": 142 }, { - "__id__": 140 + "__id__": 144 } ], "_prefab": { - "__id__": 142 + "__id__": 146 }, "_lpos": { "__type__": "cc.Vec3", @@ -3441,11 +3537,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 137 + "__id__": 141 }, "_enabled": true, "__prefab": { - "__id__": 139 + "__id__": 143 }, "_contentSize": { "__type__": "cc.Size", @@ -3469,11 +3565,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 137 + "__id__": 141 }, "_enabled": true, "__prefab": { - "__id__": 141 + "__id__": 145 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -3527,20 +3623,20 @@ "_objFlags": 0, "__editorExtras__": {}, "_parent": { - "__id__": 136 + "__id__": 140 }, "_children": [], "_active": true, "_components": [ { - "__id__": 144 + "__id__": 148 }, { - "__id__": 146 + "__id__": 150 } ], "_prefab": { - "__id__": 148 + "__id__": 152 }, "_lpos": { "__type__": "cc.Vec3", @@ -3577,11 +3673,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 143 + "__id__": 147 }, "_enabled": true, "__prefab": { - "__id__": 145 + "__id__": 149 }, "_contentSize": { "__type__": "cc.Size", @@ -3605,11 +3701,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 143 + "__id__": 147 }, "_enabled": true, "__prefab": { - "__id__": 147 + "__id__": 151 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -3686,11 +3782,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 136 + "__id__": 140 }, "_enabled": true, "__prefab": { - "__id__": 150 + "__id__": 154 }, "_contentSize": { "__type__": "cc.Size", @@ -3714,11 +3810,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 136 + "__id__": 140 }, "_enabled": true, "__prefab": { - "__id__": 152 + "__id__": 156 }, "_resizeMode": 0, "_layoutType": 1, @@ -3765,11 +3861,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 129 + "__id__": 133 }, "_enabled": true, "__prefab": { - "__id__": 155 + "__id__": 159 }, "_contentSize": { "__type__": "cc.Size", @@ -3793,11 +3889,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 129 + "__id__": 133 }, "_enabled": true, "__prefab": { - "__id__": 157 + "__id__": 161 }, "clickEvents": [], "_interactable": true, @@ -3837,7 +3933,7 @@ "_duration": 0.1, "_zoomScale": 1.2, "_target": { - "__id__": 129 + "__id__": 133 }, "_id": "" }, @@ -3864,27 +3960,27 @@ "_objFlags": 0, "__editorExtras__": {}, "_parent": { - "__id__": 98 + "__id__": 102 }, "_children": [ { - "__id__": 160 + "__id__": 164 }, { - "__id__": 166 + "__id__": 170 } ], "_active": false, "_components": [ { - "__id__": 184 + "__id__": 188 }, { - "__id__": 186 + "__id__": 190 } ], "_prefab": { - "__id__": 188 + "__id__": 192 }, "_lpos": { "__type__": "cc.Vec3", @@ -3921,20 +4017,20 @@ "_objFlags": 0, "__editorExtras__": {}, "_parent": { - "__id__": 159 + "__id__": 163 }, "_children": [], "_active": true, "_components": [ { - "__id__": 161 + "__id__": 165 }, { - "__id__": 163 + "__id__": 167 } ], "_prefab": { - "__id__": 165 + "__id__": 169 }, "_lpos": { "__type__": "cc.Vec3", @@ -3971,11 +4067,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 160 + "__id__": 164 }, "_enabled": true, "__prefab": { - "__id__": 162 + "__id__": 166 }, "_contentSize": { "__type__": "cc.Size", @@ -3999,11 +4095,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 160 + "__id__": 164 }, "_enabled": true, "__prefab": { - "__id__": 164 + "__id__": 168 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -4057,27 +4153,27 @@ "_objFlags": 0, "__editorExtras__": {}, "_parent": { - "__id__": 159 + "__id__": 163 }, "_children": [ { - "__id__": 167 + "__id__": 171 }, { - "__id__": 173 + "__id__": 177 } ], "_active": true, "_components": [ { - "__id__": 179 + "__id__": 183 }, { - "__id__": 181 + "__id__": 185 } ], "_prefab": { - "__id__": 183 + "__id__": 187 }, "_lpos": { "__type__": "cc.Vec3", @@ -4114,20 +4210,20 @@ "_objFlags": 0, "__editorExtras__": {}, "_parent": { - "__id__": 166 + "__id__": 170 }, "_children": [], "_active": true, "_components": [ { - "__id__": 168 + "__id__": 172 }, { - "__id__": 170 + "__id__": 174 } ], "_prefab": { - "__id__": 172 + "__id__": 176 }, "_lpos": { "__type__": "cc.Vec3", @@ -4164,11 +4260,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 167 + "__id__": 171 }, "_enabled": true, "__prefab": { - "__id__": 169 + "__id__": 173 }, "_contentSize": { "__type__": "cc.Size", @@ -4192,11 +4288,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 167 + "__id__": 171 }, "_enabled": true, "__prefab": { - "__id__": 171 + "__id__": 175 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -4250,20 +4346,20 @@ "_objFlags": 0, "__editorExtras__": {}, "_parent": { - "__id__": 166 + "__id__": 170 }, "_children": [], "_active": true, "_components": [ { - "__id__": 174 + "__id__": 178 }, { - "__id__": 176 + "__id__": 180 } ], "_prefab": { - "__id__": 178 + "__id__": 182 }, "_lpos": { "__type__": "cc.Vec3", @@ -4300,11 +4396,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 173 + "__id__": 177 }, "_enabled": true, "__prefab": { - "__id__": 175 + "__id__": 179 }, "_contentSize": { "__type__": "cc.Size", @@ -4328,11 +4424,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 173 + "__id__": 177 }, "_enabled": true, "__prefab": { - "__id__": 177 + "__id__": 181 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -4409,11 +4505,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 166 + "__id__": 170 }, "_enabled": true, "__prefab": { - "__id__": 180 + "__id__": 184 }, "_contentSize": { "__type__": "cc.Size", @@ -4437,11 +4533,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 166 + "__id__": 170 }, "_enabled": true, "__prefab": { - "__id__": 182 + "__id__": 186 }, "_resizeMode": 0, "_layoutType": 1, @@ -4488,11 +4584,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 159 + "__id__": 163 }, "_enabled": true, "__prefab": { - "__id__": 185 + "__id__": 189 }, "_contentSize": { "__type__": "cc.Size", @@ -4516,11 +4612,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 159 + "__id__": 163 }, "_enabled": true, "__prefab": { - "__id__": 187 + "__id__": 191 }, "clickEvents": [], "_interactable": true, @@ -4560,7 +4656,7 @@ "_duration": 0.1, "_zoomScale": 1.2, "_target": { - "__id__": 159 + "__id__": 163 }, "_id": "" }, @@ -4587,27 +4683,27 @@ "_objFlags": 0, "__editorExtras__": {}, "_parent": { - "__id__": 98 + "__id__": 102 }, "_children": [ { - "__id__": 190 + "__id__": 194 } ], "_active": true, "_components": [ - { - "__id__": 196 - }, - { - "__id__": 198 - }, { "__id__": 200 + }, + { + "__id__": 202 + }, + { + "__id__": 204 } ], "_prefab": { - "__id__": 202 + "__id__": 206 }, "_lpos": { "__type__": "cc.Vec3", @@ -4644,20 +4740,20 @@ "_objFlags": 0, "__editorExtras__": {}, "_parent": { - "__id__": 189 + "__id__": 193 }, "_children": [], "_active": true, "_components": [ { - "__id__": 191 + "__id__": 195 }, { - "__id__": 193 + "__id__": 197 } ], "_prefab": { - "__id__": 195 + "__id__": 199 }, "_lpos": { "__type__": "cc.Vec3", @@ -4694,11 +4790,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 190 + "__id__": 194 }, "_enabled": true, "__prefab": { - "__id__": 192 + "__id__": 196 }, "_contentSize": { "__type__": "cc.Size", @@ -4722,11 +4818,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 190 + "__id__": 194 }, "_enabled": true, "__prefab": { - "__id__": 194 + "__id__": 198 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -4803,11 +4899,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 189 + "__id__": 193 }, "_enabled": true, "__prefab": { - "__id__": 197 + "__id__": 201 }, "_contentSize": { "__type__": "cc.Size", @@ -4831,11 +4927,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 189 + "__id__": 193 }, "_enabled": true, "__prefab": { - "__id__": 199 + "__id__": 203 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -4876,11 +4972,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 189 + "__id__": 193 }, "_enabled": true, "__prefab": { - "__id__": 201 + "__id__": 205 }, "clickEvents": [], "_interactable": true, @@ -4945,27 +5041,27 @@ "_objFlags": 0, "__editorExtras__": {}, "_parent": { - "__id__": 98 + "__id__": 102 }, "_children": [ { - "__id__": 204 + "__id__": 208 } ], "_active": true, "_components": [ - { - "__id__": 210 - }, - { - "__id__": 212 - }, { "__id__": 214 + }, + { + "__id__": 216 + }, + { + "__id__": 218 } ], "_prefab": { - "__id__": 216 + "__id__": 220 }, "_lpos": { "__type__": "cc.Vec3", @@ -5002,20 +5098,20 @@ "_objFlags": 0, "__editorExtras__": {}, "_parent": { - "__id__": 203 + "__id__": 207 }, "_children": [], "_active": true, "_components": [ { - "__id__": 205 + "__id__": 209 }, { - "__id__": 207 + "__id__": 211 } ], "_prefab": { - "__id__": 209 + "__id__": 213 }, "_lpos": { "__type__": "cc.Vec3", @@ -5052,11 +5148,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 204 + "__id__": 208 }, "_enabled": true, "__prefab": { - "__id__": 206 + "__id__": 210 }, "_contentSize": { "__type__": "cc.Size", @@ -5080,11 +5176,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 204 + "__id__": 208 }, "_enabled": true, "__prefab": { - "__id__": 208 + "__id__": 212 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -5161,11 +5257,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 203 + "__id__": 207 }, "_enabled": true, "__prefab": { - "__id__": 211 + "__id__": 215 }, "_contentSize": { "__type__": "cc.Size", @@ -5189,11 +5285,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 203 + "__id__": 207 }, "_enabled": true, "__prefab": { - "__id__": 213 + "__id__": 217 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -5234,11 +5330,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 203 + "__id__": 207 }, "_enabled": true, "__prefab": { - "__id__": 215 + "__id__": 219 }, "clickEvents": [], "_interactable": true, @@ -5303,11 +5399,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 98 + "__id__": 102 }, "_enabled": true, "__prefab": { - "__id__": 218 + "__id__": 222 }, "_contentSize": { "__type__": "cc.Size", @@ -5331,11 +5427,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 98 + "__id__": 102 }, "_enabled": true, "__prefab": { - "__id__": 220 + "__id__": 224 }, "_resizeMode": 1, "_layoutType": 2, @@ -5369,11 +5465,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 98 + "__id__": 102 }, "_enabled": true, "__prefab": { - "__id__": 222 + "__id__": 226 }, "_alignFlags": 4, "_target": null, @@ -5415,33 +5511,36 @@ { "__type__": "cc.Node", "_name": "Input", - "_objFlags": 512, + "_objFlags": 0, "__editorExtras__": {}, "_parent": { "__id__": 1 }, "_children": [ { - "__id__": 225 + "__id__": 229 }, { - "__id__": 231 - } - ], - "_active": true, - "_components": [ - { - "__id__": 237 - }, - { - "__id__": 239 + "__id__": 235 }, { "__id__": 241 } ], + "_active": true, + "_components": [ + { + "__id__": 247 + }, + { + "__id__": 249 + }, + { + "__id__": 251 + } + ], "_prefab": { - "__id__": 243 + "__id__": 253 }, "_lpos": { "__type__": "cc.Vec3", @@ -5475,23 +5574,23 @@ { "__type__": "cc.Node", "_name": "TEXT_LABEL", - "_objFlags": 512, + "_objFlags": 0, "__editorExtras__": {}, "_parent": { - "__id__": 224 + "__id__": 228 }, "_children": [], "_active": false, "_components": [ { - "__id__": 226 + "__id__": 230 }, { - "__id__": 228 + "__id__": 232 } ], "_prefab": { - "__id__": 230 + "__id__": 234 }, "_lpos": { "__type__": "cc.Vec3", @@ -5528,11 +5627,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 225 + "__id__": 229 }, "_enabled": true, "__prefab": { - "__id__": 227 + "__id__": 231 }, "_contentSize": { "__type__": "cc.Size", @@ -5556,29 +5655,29 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 225 + "__id__": 229 }, "_enabled": true, "__prefab": { - "__id__": 229 + "__id__": 233 }, "_customMaterial": null, "_srcBlendFactor": 2, "_dstBlendFactor": 4, "_color": { "__type__": "cc.Color", - "r": 255, - "g": 255, - "b": 255, + "r": 0, + "g": 0, + "b": 0, "a": 255 }, "_string": "", "_horizontalAlign": 0, "_verticalAlign": 1, "_actualFontSize": 40, - "_fontSize": 100, + "_fontSize": 60, "_fontFamily": "Arial", - "_lineHeight": 100, + "_lineHeight": 60, "_overflow": 1, "_enableWrapText": false, "_font": null, @@ -5634,23 +5733,23 @@ { "__type__": "cc.Node", "_name": "PLACEHOLDER_LABEL", - "_objFlags": 512, + "_objFlags": 0, "__editorExtras__": {}, "_parent": { - "__id__": 224 + "__id__": 228 }, "_children": [], "_active": true, "_components": [ { - "__id__": 232 + "__id__": 236 }, { - "__id__": 234 + "__id__": 238 } ], "_prefab": { - "__id__": 236 + "__id__": 240 }, "_lpos": { "__type__": "cc.Vec3", @@ -5687,11 +5786,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 231 + "__id__": 235 }, "_enabled": true, "__prefab": { - "__id__": 233 + "__id__": 237 }, "_contentSize": { "__type__": "cc.Size", @@ -5715,27 +5814,27 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 231 + "__id__": 235 }, "_enabled": true, "__prefab": { - "__id__": 235 + "__id__": 239 }, "_customMaterial": null, "_srcBlendFactor": 2, "_dstBlendFactor": 4, "_color": { "__type__": "cc.Color", - "r": 187, - "g": 187, - "b": 187, + "r": 97, + "g": 78, + "b": 78, "a": 255 }, "_string": "填写答案", "_horizontalAlign": 0, "_verticalAlign": 1, - "_actualFontSize": 20, - "_fontSize": 20, + "_actualFontSize": 40, + "_fontSize": 40, "_fontFamily": "Arial", "_lineHeight": 40, "_overflow": 1, @@ -5790,17 +5889,153 @@ "targetOverrides": null, "nestedPrefabInstanceRoots": null }, + { + "__type__": "cc.Node", + "_name": "UnderLine", + "_objFlags": 0, + "__editorExtras__": {}, + "_parent": { + "__id__": 228 + }, + "_children": [], + "_active": true, + "_components": [ + { + "__id__": 242 + }, + { + "__id__": 244 + } + ], + "_prefab": { + "__id__": 246 + }, + "_lpos": { + "__type__": "cc.Vec3", + "x": -26.007, + "y": -40.051, + "z": 0 + }, + "_lrot": { + "__type__": "cc.Quat", + "x": 0, + "y": 0, + "z": 0, + "w": 1 + }, + "_lscale": { + "__type__": "cc.Vec3", + "x": 1, + "y": 1, + "z": 1 + }, + "_mobility": 0, + "_layer": 1073741824, + "_euler": { + "__type__": "cc.Vec3", + "x": 0, + "y": 0, + "z": 0 + }, + "_id": "" + }, { "__type__": "cc.UITransform", "_name": "", "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 224 + "__id__": 241 }, "_enabled": true, "__prefab": { - "__id__": 238 + "__id__": 243 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 40, + "height": 1 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_id": "" + }, + { + "__type__": "cc.CompPrefabInfo", + "fileId": "bde2lMxxRHg4jYIKtaZje5" + }, + { + "__type__": "cc.Sprite", + "_name": "", + "_objFlags": 0, + "__editorExtras__": {}, + "node": { + "__id__": 241 + }, + "_enabled": true, + "__prefab": { + "__id__": 245 + }, + "_customMaterial": null, + "_srcBlendFactor": 2, + "_dstBlendFactor": 4, + "_color": { + "__type__": "cc.Color", + "r": 0, + "g": 0, + "b": 0, + "a": 255 + }, + "_spriteFrame": { + "__uuid__": "57520716-48c8-4a19-8acf-41c9f8777fb0@f9941", + "__expectedType__": "cc.SpriteFrame" + }, + "_type": 0, + "_fillType": 0, + "_sizeMode": 0, + "_fillCenter": { + "__type__": "cc.Vec2", + "x": 0, + "y": 0 + }, + "_fillStart": 0, + "_fillRange": 0, + "_isTrimmedMode": true, + "_useGrayscale": false, + "_atlas": null, + "_id": "" + }, + { + "__type__": "cc.CompPrefabInfo", + "fileId": "0481kwtltMypY5waabkKHw" + }, + { + "__type__": "cc.PrefabInfo", + "root": { + "__id__": 1 + }, + "asset": { + "__id__": 0 + }, + "fileId": "7exOpNCURGGrdZ/DiXF3Qm", + "instance": null, + "targetOverrides": null, + "nestedPrefabInstanceRoots": null + }, + { + "__type__": "cc.UITransform", + "_name": "", + "_objFlags": 0, + "__editorExtras__": {}, + "node": { + "__id__": 228 + }, + "_enabled": true, + "__prefab": { + "__id__": 248 }, "_contentSize": { "__type__": "cc.Size", @@ -5824,11 +6059,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 224 + "__id__": 228 }, "_enabled": true, "__prefab": { - "__id__": 240 + "__id__": 250 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -5866,21 +6101,21 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 224 + "__id__": 228 }, "_enabled": true, "__prefab": { - "__id__": 242 + "__id__": 252 }, "editingDidBegan": [], "textChanged": [], "editingDidEnded": [], "editingReturn": [], "_textLabel": { - "__id__": 228 + "__id__": 232 }, "_placeholderLabel": { - "__id__": 234 + "__id__": 238 }, "_returnType": 0, "_string": "", @@ -5918,7 +6153,7 @@ }, "_enabled": true, "__prefab": { - "__id__": 245 + "__id__": 255 }, "_contentSize": { "__type__": "cc.Size", @@ -5946,7 +6181,7 @@ }, "_enabled": true, "__prefab": { - "__id__": 247 + "__id__": 257 }, "_alignFlags": 0, "_target": null, @@ -5982,7 +6217,7 @@ }, "_enabled": true, "__prefab": { - "__id__": 249 + "__id__": 259 }, "inputLayout": { "__id__": 70 @@ -5991,7 +6226,7 @@ "__id__": 76 }, "inputTemplate": { - "__id__": 224 + "__id__": 228 }, "actionNode": { "__id__": 63 @@ -6000,25 +6235,25 @@ "__id__": 10 }, "tipsLayout": { - "__id__": 98 + "__id__": 102 }, "mainImage": { "__id__": 57 }, "tipsItem1": { - "__id__": 99 + "__id__": 103 }, "tipsItem2": { - "__id__": 129 + "__id__": 133 }, "tipsItem3": { - "__id__": 159 + "__id__": 163 }, "unLockItem2": { - "__id__": 189 + "__id__": 193 }, "unLockItem3": { - "__id__": 203 + "__id__": 207 }, "clockLabel": { "__id__": 48 @@ -6028,10 +6263,10 @@ }, "levelConfigs": [ { - "__id__": 250 + "__id__": 260 }, { - "__id__": 251 + "__id__": 261 } ], "currentLevelIndex": 0, @@ -6085,7 +6320,7 @@ }, "_enabled": true, "__prefab": { - "__id__": 253 + "__id__": 263 }, "_clip": null, "_loop": false, diff --git a/assets/prefabs/PageLevel.ts b/assets/prefabs/PageLevel.ts index 999c62a..d01c92f 100644 --- a/assets/prefabs/PageLevel.ts +++ b/assets/prefabs/PageLevel.ts @@ -1,7 +1,8 @@ -import { _decorator, Node, EditBox, instantiate, Vec3, Button, Label, Sprite, SpriteFrame, AudioClip, AudioSource } from 'cc'; +import { _decorator, Node, EditBox, instantiate, Vec3, Button, Label, Sprite, SpriteFrame, AudioClip, AudioSource, UITransform } from 'cc'; import { BaseView } from 'db://assets/scripts/core/BaseView'; import { ViewManager } from 'db://assets/scripts/core/ViewManager'; import { StorageManager } from 'db://assets/scripts/utils/StorageManager'; +import { WxSDK } from 'db://assets/scripts/utils/WxSDK'; const { ccclass, property } = _decorator; /** @@ -168,25 +169,21 @@ export class PageLevel extends BaseView { this.showUnlockButton(2); this.showUnlockButton(3); - // 根据答案长度创建输入框 - const inputCount = config.answer.length; - this.createInputs(inputCount); - - // 隐藏提交按钮 - if (this.submitButton) { - this.submitButton.active = false; - } + // 根据答案长度创建单个输入框 + const answerLength = config.answer.length; + this.createSingleInput(answerLength); // 更新倒计时显示 this.updateClockLabel(); - console.log(`[PageLevel] 初始化关卡 ${this.currentLevelIndex + 1}, 答案长度: ${inputCount}`); + console.log(`[PageLevel] 初始化关卡 ${this.currentLevelIndex + 1}, 答案长度: ${answerLength}`); } /** - * 动态创建输入框 + * 创建单个输入框 + * @param answerLength 答案长度,用于设置 placeholder 和宽度 */ - private createInputs(count: number): void { + private createSingleInput(answerLength: number): void { if (!this.inputLayout || !this.inputTemplate) { console.error('[PageLevel] inputLayout 或 inputTemplate 未设置'); return; @@ -198,31 +195,53 @@ export class PageLevel extends BaseView { // 隐藏模板节点 this.inputTemplate.active = false; - // 创建指定数量的输入框 - for (let i = 0; i < count; i++) { - const inputNode = instantiate(this.inputTemplate); - inputNode.active = true; - inputNode.name = `input${i}`; + // 创建单个输入框 + const inputNode = instantiate(this.inputTemplate); + inputNode.active = true; + inputNode.name = 'singleInput'; - // 设置位置(Layout 会自动排列) - inputNode.setPosition(new Vec3(0, 0, 0)); + // 设置位置 + inputNode.setPosition(new Vec3(0, 0, 0)); - // 获取 EditBox 组件并监听事件 - const editBox = inputNode.getComponent(EditBox); - if (editBox) { - // 清空输入内容 - editBox.string = ''; - // 监听文本变化事件 - editBox.node.on(EditBox.EventType.TEXT_CHANGED, this.onInputTextChanged, this); - // 监听编辑结束事件 - editBox.node.on(EditBox.EventType.EDITING_DID_ENDED, this.onInputEditingEnded, this); - } + // 获取 EditBox 组件 + const editBox = inputNode.getComponent(EditBox); + if (editBox) { + // 设置 placeholder 提示 + editBox.placeholder = `(${answerLength}个字)`; - this.inputLayout.addChild(inputNode); - this._inputNodes.push(inputNode); + // 设置最大长度为答案长度 + editBox.maxLength = answerLength; + + // 清空输入内容 + editBox.string = ''; + + // 监听事件 + editBox.node.on(EditBox.EventType.TEXT_CHANGED, this.onInputTextChanged, this); + editBox.node.on(EditBox.EventType.EDITING_DID_ENDED, this.onInputEditingEnded, this); } - console.log(`[PageLevel] 创建了 ${count} 个输入框`); + // 动态调整输入框宽度 + const uitransform = inputNode.getComponent(UITransform); + let inputWidth = 200; + if (uitransform) { + // 每个字符约 60px,加上 padding + inputWidth = Math.min(600, Math.max(200, answerLength * 60 + 40)); + uitransform.setContentSize(inputWidth, 100); + } + + // 调整下划线宽度与输入框一致 + const underLine = inputNode.getChildByName('UnderLine'); + if (underLine) { + const underLineTransform = underLine.getComponent(UITransform); + if (underLineTransform) { + underLineTransform.setContentSize(inputWidth, underLineTransform.height); + } + } + + this.inputLayout.addChild(inputNode); + this._inputNodes.push(inputNode); + + console.log(`[PageLevel] 创建单个输入框,答案长度: ${answerLength}`); } /** @@ -237,110 +256,39 @@ export class PageLevel extends BaseView { this._inputNodes = []; } - /** - * 检查所有输入框是否都已填写 - */ - private checkAllInputsFilled(): void { - let allFilled = true; - - for (const node of this._inputNodes) { - const editBox = node.getComponent(EditBox); - if (!editBox || editBox.string.trim() === '') { - allFilled = false; - break; - } - } - - // 根据填写状态显示/隐藏提交按钮 - if (this.submitButton) { - this.submitButton.active = allFilled; - } - - console.log(`[PageLevel] 检查输入状态: ${allFilled ? '全部已填写' : '未全部填写'}`); - } - /** * 获取所有输入框的值 */ getInputValues(): string[] { - const values: string[] = []; - for (const node of this._inputNodes) { - const editBox = node.getComponent(EditBox); - // 只取第一个字符,去除空格 - const str = (editBox?.string ?? '').trim(); - values.push(str.charAt(0)); - } - return values; + if (this._inputNodes.length === 0) return []; + const editBox = this._inputNodes[0].getComponent(EditBox); + const str = (editBox?.string ?? '').trim(); + return [str]; } /** * 获取拼接后的答案字符串 */ getAnswer(): string { - return this.getInputValues().join(''); + if (this._inputNodes.length === 0) return ''; + const editBox = this._inputNodes[0].getComponent(EditBox); + return (editBox?.string ?? '').trim(); } // ========== EditBox 事件回调 ========== - /** 是否正在处理输入(防止递归) */ - private _isHandlingInput: boolean = false; - /** * 输入框文本变化回调 */ - private onInputTextChanged(editBox: EditBox): void { - // 防止递归调用 - if (this._isHandlingInput) return; - - // 处理多字符输入,自动分配到后续输入框 - this.handleMultiCharInput(editBox); - this.checkAllInputsFilled(); - } - - /** - * 处理多字符输入,自动分配到后续输入框 - */ - private handleMultiCharInput(editBox: EditBox): void { - const text = editBox.string; - if (text.length <= 1) return; - - // 找到当前输入框的索引 - const currentIndex = this._inputNodes.findIndex(node => node.getComponent(EditBox) === editBox); - if (currentIndex === -1) return; - - // 标记正在处理输入 - this._isHandlingInput = true; - - // 保留第一个字符在当前输入框 - const firstChar = text[0]; - const remainingChars = text.slice(1); - - // 设置当前输入框只保留第一个字符 - editBox.string = firstChar; - - // 将剩余字符分配到后续输入框 - for (let i = 0; i < remainingChars.length; i++) { - const nextIndex = currentIndex + 1 + i; - if (nextIndex < this._inputNodes.length) { - const nextEditBox = this._inputNodes[nextIndex].getComponent(EditBox); - if (nextEditBox) { - // 只在目标输入框为空时填入 - if (nextEditBox.string === '') { - nextEditBox.string = remainingChars[i]; - } - } - } - } - - // 处理完成 - this._isHandlingInput = false; + private onInputTextChanged(_editBox: EditBox): void { + console.log('[PageLevel] 输入内容变化'); } /** * 输入框编辑结束回调 */ private onInputEditingEnded(_editBox: EditBox): void { - this.checkAllInputsFilled(); + console.log('[PageLevel] 输入编辑结束'); } // ========== IconSetting 按钮相关 ========== @@ -533,41 +481,34 @@ export class PageLevel extends BaseView { // ========== 音效相关方法 ========== + /** + * 播放音效(通用方法) + */ + private playSound(clip: AudioClip | null): void { + if (!clip) return; + const audioSource = this.node.getComponent(AudioSource); + audioSource?.playOneShot(clip); + } + /** * 播放点击音效 */ private playClickSound(): void { - if (this.clickAudio) { - // 使用 audioSource 组件播放一次性音效 - const audioSource = this.node.getComponent(AudioSource); - if (audioSource) { - audioSource.playOneShot(this.clickAudio); - } - } + this.playSound(this.clickAudio); } /** * 播放成功音效 */ private playSuccessSound(): void { - if (this.successAudio) { - const audioSource = this.node.getComponent(AudioSource); - if (audioSource) { - audioSource.playOneShot(this.successAudio); - } - } + this.playSound(this.successAudio); } /** * 播放失败音效 */ private playFailSound(): void { - if (this.failAudio) { - const audioSource = this.node.getComponent(AudioSource); - if (audioSource) { - audioSource.playOneShot(this.failAudio); - } - } + this.playSound(this.failAudio); } // ========== 倒计时相关方法 ========== @@ -719,6 +660,9 @@ export class PageLevel extends BaseView { // 播放失败音效 this.playFailSound(); + + // 触发手机震动 + WxSDK.vibrateLong(); } /** diff --git a/assets/resources/images/pageLevel/ContentBg.png b/assets/resources/images/pageLevel/ContentBg.png new file mode 100644 index 0000000..504c7ab Binary files /dev/null and b/assets/resources/images/pageLevel/ContentBg.png differ diff --git a/assets/resources/images/pageLevel/ContentBg.png.meta b/assets/resources/images/pageLevel/ContentBg.png.meta new file mode 100644 index 0000000..e830483 --- /dev/null +++ b/assets/resources/images/pageLevel/ContentBg.png.meta @@ -0,0 +1,134 @@ +{ + "ver": "1.0.27", + "importer": "image", + "imported": true, + "uuid": "a34c93d2-cae0-42d4-a2eb-c3155052ad20", + "files": [ + ".json", + ".png" + ], + "subMetas": { + "6c48a": { + "importer": "texture", + "uuid": "a34c93d2-cae0-42d4-a2eb-c3155052ad20@6c48a", + "displayName": "ContentBg", + "id": "6c48a", + "name": "texture", + "userData": { + "wrapModeS": "clamp-to-edge", + "wrapModeT": "clamp-to-edge", + "imageUuidOrDatabaseUri": "a34c93d2-cae0-42d4-a2eb-c3155052ad20", + "isUuid": true, + "visible": false, + "minfilter": "linear", + "magfilter": "linear", + "mipfilter": "none", + "anisotropy": 0 + }, + "ver": "1.0.22", + "imported": true, + "files": [ + ".json" + ], + "subMetas": {} + }, + "f9941": { + "importer": "sprite-frame", + "uuid": "a34c93d2-cae0-42d4-a2eb-c3155052ad20@f9941", + "displayName": "ContentBg", + "id": "f9941", + "name": "spriteFrame", + "userData": { + "trimThreshold": 1, + "rotated": false, + "offsetX": 0, + "offsetY": 0, + "trimX": 0, + "trimY": 0, + "width": 304, + "height": 404, + "rawWidth": 304, + "rawHeight": 404, + "borderTop": 0, + "borderBottom": 0, + "borderLeft": 0, + "borderRight": 0, + "packable": true, + "pixelsToUnit": 100, + "pivotX": 0.5, + "pivotY": 0.5, + "meshType": 0, + "vertices": { + "rawPosition": [ + -152, + -202, + 0, + 152, + -202, + 0, + -152, + 202, + 0, + 152, + 202, + 0 + ], + "indexes": [ + 0, + 1, + 2, + 2, + 1, + 3 + ], + "uv": [ + 0, + 404, + 304, + 404, + 0, + 0, + 304, + 0 + ], + "nuv": [ + 0, + 0, + 1, + 0, + 0, + 1, + 1, + 1 + ], + "minPos": [ + -152, + -202, + 0 + ], + "maxPos": [ + 152, + 202, + 0 + ] + }, + "isUuid": true, + "imageUuidOrDatabaseUri": "a34c93d2-cae0-42d4-a2eb-c3155052ad20@6c48a", + "atlasUuid": "", + "trimType": "auto" + }, + "ver": "1.0.12", + "imported": true, + "files": [ + ".json" + ], + "subMetas": {} + } + }, + "userData": { + "type": "sprite-frame", + "fixAlphaTransparencyArtifacts": false, + "hasAlpha": true, + "redirect": "a34c93d2-cae0-42d4-a2eb-c3155052ad20@6c48a" + } +} diff --git a/assets/scripts/utils/WxSDK.ts b/assets/scripts/utils/WxSDK.ts index d5563b2..6b6db62 100644 --- a/assets/scripts/utils/WxSDK.ts +++ b/assets/scripts/utils/WxSDK.ts @@ -145,4 +145,43 @@ export class WxSDK { console.log('[WxSDK] 分享功能初始化完成'); } + + // ==================== 震动相关 ==================== + + /** + * 触发短震动(15ms) + * 用于轻量级反馈,如按钮点击 + */ + static vibrateShort(): void { + const wxApi = WxSDK.getWx(); + if (!wxApi) return; + + wxApi.vibrateShort({ + type: 'medium', + success: () => { + console.log('[WxSDK] 短震动成功'); + }, + fail: (err: any) => { + console.warn('[WxSDK] 短震动失败', err); + } + }); + } + + /** + * 触发长震动(400ms) + * 用于重要反馈,如错误提示 + */ + static vibrateLong(): void { + const wxApi = WxSDK.getWx(); + if (!wxApi) return; + + wxApi.vibrateLong({ + success: () => { + console.log('[WxSDK] 长震动成功'); + }, + fail: (err: any) => { + console.warn('[WxSDK] 长震动失败', err); + } + }); + } }