From 2e4674c3c1e31ac33da996e73fcaf2bc5485cc5c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BD=95=E5=8D=97=E5=9B=BD?= <164292041@qq.com> Date: Mon, 27 Apr 2026 15:42:42 +0800 Subject: [PATCH] =?UTF-8?q?[update]=E6=96=B0=E5=A2=9E=E9=AA=B0=E5=AD=90?= =?UTF-8?q?=E8=AE=A1=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 游标移动时,剩余步数增加倒计时 --- .../app-view/page/main/native/PageMain.prefab | 380 ++++++++++++++++-- .../app-view/page/main/native/PageMain.ts | 13 + 2 files changed, 359 insertions(+), 34 deletions(-) diff --git a/assets/app-bundle/app-view/page/main/native/PageMain.prefab b/assets/app-bundle/app-view/page/main/native/PageMain.prefab index 09d64cb..c4cb677 100644 --- a/assets/app-bundle/app-view/page/main/native/PageMain.prefab +++ b/assets/app-bundle/app-view/page/main/native/PageMain.prefab @@ -53,22 +53,25 @@ }, { "__id__": 1624 + }, + { + "__id__": 1636 } ], "_active": true, "_components": [ { - "__id__": 1640 + "__id__": 1652 }, { - "__id__": 1642 + "__id__": 1654 }, { - "__id__": 1644 + "__id__": 1656 } ], "_prefab": { - "__id__": 1646 + "__id__": 1658 }, "_lpos": { "__type__": "cc.Vec3", @@ -39442,7 +39445,9 @@ "_disabledSprite": null, "_duration": 0.1, "_zoomScale": 1.2, - "_target": null, + "_target": { + "__id__": 1592 + }, "_id": "" }, { @@ -39498,7 +39503,9 @@ "_disabledSprite": null, "_duration": 0.1, "_zoomScale": 1.2, - "_target": null, + "_target": { + "__id__": 1592 + }, "_id": "" }, { @@ -39520,7 +39527,7 @@ }, { "__type__": "cc.Node", - "_name": "item_times", + "_name": "dice", "_objFlags": 0, "__editorExtras__": {}, "_parent": { @@ -39529,24 +39536,24 @@ "_children": [ { "__id__": 1625 - }, - { - "__id__": 1631 } ], "_active": false, "_components": [ { - "__id__": 1637 + "__id__": 1631 + }, + { + "__id__": 1633 } ], "_prefab": { - "__id__": 1639 + "__id__": 1635 }, "_lpos": { "__type__": "cc.Vec3", - "x": 0, - "y": 0, + "x": 355, + "y": 375, "z": 0 }, "_lrot": { @@ -39558,8 +39565,8 @@ }, "_lscale": { "__type__": "cc.Vec3", - "x": 1, - "y": 1, + "x": 0.5, + "y": 0.5, "z": 1 }, "_mobility": 0, @@ -39574,7 +39581,7 @@ }, { "__type__": "cc.Node", - "_name": "line", + "_name": "lab", "_objFlags": 0, "__editorExtras__": {}, "_parent": { @@ -39596,7 +39603,7 @@ "_lpos": { "__type__": "cc.Vec3", "x": 0, - "y": -29, + "y": 0, "z": 0 }, "_lrot": { @@ -39634,6 +39641,308 @@ "__prefab": { "__id__": 1627 }, + "_contentSize": { + "__type__": "cc.Size", + "width": 0, + "height": 40 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_id": "" + }, + { + "__type__": "cc.CompPrefabInfo", + "fileId": "491xTcN8FCsIycffy82D2+" + }, + { + "__type__": "cc.Label", + "_name": "", + "_objFlags": 0, + "__editorExtras__": {}, + "node": { + "__id__": 1625 + }, + "_enabled": true, + "__prefab": { + "__id__": 1629 + }, + "_customMaterial": null, + "_srcBlendFactor": 2, + "_dstBlendFactor": 4, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_string": "", + "_horizontalAlign": 1, + "_verticalAlign": 1, + "_actualFontSize": 160, + "_fontSize": 160, + "_fontFamily": "Arial", + "_lineHeight": 40, + "_overflow": 0, + "_enableWrapText": true, + "_font": { + "__uuid__": "a199ec88-3efe-4751-8bd3-149a35710fc8", + "__expectedType__": "cc.BitmapFont" + }, + "_isSystemFontUsed": false, + "_spacingX": 6, + "_isItalic": false, + "_isBold": false, + "_isUnderline": false, + "_underlineHeight": 2, + "_cacheMode": 0, + "_enableOutline": false, + "_outlineColor": { + "__type__": "cc.Color", + "r": 0, + "g": 0, + "b": 0, + "a": 255 + }, + "_outlineWidth": 2, + "_enableShadow": false, + "_shadowColor": { + "__type__": "cc.Color", + "r": 0, + "g": 0, + "b": 0, + "a": 255 + }, + "_shadowOffset": { + "__type__": "cc.Vec2", + "x": 2, + "y": 2 + }, + "_shadowBlur": 2, + "_id": "" + }, + { + "__type__": "cc.CompPrefabInfo", + "fileId": "95UzI/Pb5FPZ058qWZaf2G" + }, + { + "__type__": "cc.PrefabInfo", + "root": { + "__id__": 1 + }, + "asset": { + "__id__": 0 + }, + "fileId": "35flUWLc1GuYxMnj7640nQ", + "instance": null, + "targetOverrides": null, + "nestedPrefabInstanceRoots": null + }, + { + "__type__": "cc.UITransform", + "_name": "", + "_objFlags": 0, + "__editorExtras__": {}, + "node": { + "__id__": 1624 + }, + "_enabled": true, + "__prefab": { + "__id__": 1632 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 365, + "height": 387 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_id": "" + }, + { + "__type__": "cc.CompPrefabInfo", + "fileId": "5fITtNNi1CQI63zT+oAVOf" + }, + { + "__type__": "cc.Sprite", + "_name": "", + "_objFlags": 0, + "__editorExtras__": {}, + "node": { + "__id__": 1624 + }, + "_enabled": true, + "__prefab": { + "__id__": 1634 + }, + "_customMaterial": null, + "_srcBlendFactor": 2, + "_dstBlendFactor": 4, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_spriteFrame": { + "__uuid__": "3881fbef-b196-44d3-8cd6-114119e29e9b@f9941", + "__expectedType__": "cc.SpriteFrame" + }, + "_type": 0, + "_fillType": 0, + "_sizeMode": 1, + "_fillCenter": { + "__type__": "cc.Vec2", + "x": 0, + "y": 0 + }, + "_fillStart": 0, + "_fillRange": 0, + "_isTrimmedMode": true, + "_useGrayscale": false, + "_atlas": null, + "_id": "" + }, + { + "__type__": "cc.CompPrefabInfo", + "fileId": "deXdbHGlpLbKrPXV0g/UKC" + }, + { + "__type__": "cc.PrefabInfo", + "root": { + "__id__": 1 + }, + "asset": { + "__id__": 0 + }, + "fileId": "62r/DJ6phEEo28SEPZBP/5", + "instance": null, + "targetOverrides": null, + "nestedPrefabInstanceRoots": null + }, + { + "__type__": "cc.Node", + "_name": "item_times", + "_objFlags": 0, + "__editorExtras__": {}, + "_parent": { + "__id__": 1 + }, + "_children": [ + { + "__id__": 1637 + }, + { + "__id__": 1643 + } + ], + "_active": false, + "_components": [ + { + "__id__": 1649 + } + ], + "_prefab": { + "__id__": 1651 + }, + "_lpos": { + "__type__": "cc.Vec3", + "x": 0, + "y": 0, + "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": 33554432, + "_euler": { + "__type__": "cc.Vec3", + "x": 0, + "y": 0, + "z": 0 + }, + "_id": "" + }, + { + "__type__": "cc.Node", + "_name": "line", + "_objFlags": 0, + "__editorExtras__": {}, + "_parent": { + "__id__": 1636 + }, + "_children": [], + "_active": true, + "_components": [ + { + "__id__": 1638 + }, + { + "__id__": 1640 + } + ], + "_prefab": { + "__id__": 1642 + }, + "_lpos": { + "__type__": "cc.Vec3", + "x": 0, + "y": -29, + "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": 33554432, + "_euler": { + "__type__": "cc.Vec3", + "x": 0, + "y": 0, + "z": 0 + }, + "_id": "" + }, + { + "__type__": "cc.UITransform", + "_name": "", + "_objFlags": 0, + "__editorExtras__": {}, + "node": { + "__id__": 1637 + }, + "_enabled": true, + "__prefab": { + "__id__": 1639 + }, "_contentSize": { "__type__": "cc.Size", "width": 253, @@ -39656,11 +39965,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 1625 + "__id__": 1637 }, "_enabled": true, "__prefab": { - "__id__": 1629 + "__id__": 1641 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -39714,20 +40023,20 @@ "_objFlags": 0, "__editorExtras__": {}, "_parent": { - "__id__": 1624 + "__id__": 1636 }, "_children": [], "_active": true, "_components": [ { - "__id__": 1632 + "__id__": 1644 }, { - "__id__": 1634 + "__id__": 1646 } ], "_prefab": { - "__id__": 1636 + "__id__": 1648 }, "_lpos": { "__type__": "cc.Vec3", @@ -39764,11 +40073,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 1631 + "__id__": 1643 }, "_enabled": true, "__prefab": { - "__id__": 1633 + "__id__": 1645 }, "_contentSize": { "__type__": "cc.Size", @@ -39792,11 +40101,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 1631 + "__id__": 1643 }, "_enabled": true, "__prefab": { - "__id__": 1635 + "__id__": 1647 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -39873,11 +40182,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 1624 + "__id__": 1636 }, "_enabled": true, "__prefab": { - "__id__": 1638 + "__id__": 1650 }, "_contentSize": { "__type__": "cc.Size", @@ -39918,7 +40227,7 @@ }, "_enabled": true, "__prefab": { - "__id__": 1641 + "__id__": 1653 }, "_hideEvent": 1, "_singleton": true, @@ -40085,6 +40394,9 @@ "dice_all": { "__id__": 1592 }, + "dice_sub": { + "__id__": 1624 + }, "btn_ante_sub": { "__id__": 1336 }, @@ -40104,7 +40416,7 @@ "__expectedType__": "cc.VideoClip" }, "item_times": { - "__id__": 1624 + "__id__": 1636 }, "list_times": { "__id__": 1392 @@ -40128,7 +40440,7 @@ }, "_enabled": true, "__prefab": { - "__id__": 1643 + "__id__": 1655 }, "_contentSize": { "__type__": "cc.Size", @@ -40156,7 +40468,7 @@ }, "_enabled": true, "__prefab": { - "__id__": 1645 + "__id__": 1657 }, "_alignFlags": 45, "_target": null, diff --git a/assets/app-bundle/app-view/page/main/native/PageMain.ts b/assets/app-bundle/app-view/page/main/native/PageMain.ts index 9af5e83..3c4bc7a 100644 --- a/assets/app-bundle/app-view/page/main/native/PageMain.ts +++ b/assets/app-bundle/app-view/page/main/native/PageMain.ts @@ -64,6 +64,8 @@ export class PageMain extends BaseView { @property(Node) ani_dice: Node = null!; /** 骰子总点数 */ @property(Node) dice_all: Node = null!; + /* 骰子倒计时 */ + @property(Node) dice_sub: Node = null!; /** 倍数减按钮 */ @property(Node) btn_ante_sub: Node = null!; @property(Node) btn_ante_add: Node = null!; @@ -402,10 +404,12 @@ export class PageMain extends BaseView { this.scheduleOnce(() => { this.dice_all.active = true Tools.SetChildText(this.dice_all, "dice/lab", steps.toString()) + Tools.SetChildText(this.dice_sub, "lab", steps.toString()) }, 1.2) this.scheduleOnce(() => { this.dice_all.active = false + this.dice_sub.active = true }, 2.4) //亮灯 @@ -468,6 +472,15 @@ export class PageMain extends BaseView { let totalTime = duration; let segmentTime = totalTime / path.length; let moveNext = (index: number) => { + let last_dice : string | number = Tools.GetChildComp(this.dice_sub, "lab" , Label).string + last_dice = parseInt(last_dice) - 1 + Tools.SetChildText(this.dice_sub, "lab", last_dice.toString()) + if (last_dice <= 0) { + this.scheduleOnce(() => { + this.dice_sub.active = false + }, 0.5) + } + let targetPos = path[index]; app.manager.sound.playEffect({name : "effect/eff_jump", volume: 0.5})