diff --git a/assets/Game/prefabs/TipMessagePanel.prefab b/assets/Game/prefabs/TipMessagePanel.prefab index bf074e0..81475a6 100644 --- a/assets/Game/prefabs/TipMessagePanel.prefab +++ b/assets/Game/prefabs/TipMessagePanel.prefab @@ -28,17 +28,17 @@ "_active": true, "_components": [ { - "__id__": 90 + "__id__": 84 }, { - "__id__": 92 + "__id__": 86 }, { - "__id__": 94 + "__id__": 88 } ], "_prefab": { - "__id__": 96 + "__id__": 90 }, "_lpos": { "__type__": "cc.Vec3", @@ -287,38 +287,35 @@ "__id__": 31 }, { - "__id__": 37 + "__id__": 39 }, { "__id__": 45 }, { - "__id__": 51 + "__id__": 53 }, { "__id__": 59 }, { - "__id__": 65 + "__id__": 67 }, { "__id__": 73 - }, - { - "__id__": 79 } ], "_active": true, "_components": [ { - "__id__": 85 + "__id__": 79 }, { - "__id__": 87 + "__id__": 81 } ], "_prefab": { - "__id__": 89 + "__id__": 83 }, "_lpos": { "__type__": "cc.Vec3", @@ -629,7 +626,7 @@ }, { "__type__": "cc.Node", - "_name": "Btn_Close_A", + "_name": "Btn_Confirm", "_objFlags": 0, "__editorExtras__": {}, "_parent": { @@ -650,8 +647,8 @@ }, "_lpos": { "__type__": "cc.Vec3", - "x": 361.82399999999996, - "y": 201.5039999999999, + "x": 200, + "y": -155, "z": 0 }, "_lrot": { @@ -689,142 +686,6 @@ "__prefab": { "__id__": 27 }, - "_contentSize": { - "__type__": "cc.Size", - "width": 50, - "height": 50 - }, - "_anchorPoint": { - "__type__": "cc.Vec2", - "x": 0.5, - "y": 0.5 - }, - "_id": "" - }, - { - "__type__": "cc.CompPrefabInfo", - "fileId": "10gA4Nb7tMrbzzyBtBAX6x" - }, - { - "__type__": "cc.Sprite", - "_name": "", - "_objFlags": 0, - "__editorExtras__": {}, - "node": { - "__id__": 25 - }, - "_enabled": true, - "__prefab": { - "__id__": 29 - }, - "_customMaterial": null, - "_srcBlendFactor": 2, - "_dstBlendFactor": 4, - "_color": { - "__type__": "cc.Color", - "r": 255, - "g": 255, - "b": 255, - "a": 255 - }, - "_spriteFrame": { - "__uuid__": "65bd128a-5b00-4ace-b646-dbf840043116@f9941", - "__expectedType__": "cc.SpriteFrame" - }, - "_type": 0, - "_fillType": 0, - "_sizeMode": 2, - "_fillCenter": { - "__type__": "cc.Vec2", - "x": 0, - "y": 0 - }, - "_fillStart": 0, - "_fillRange": 0, - "_isTrimmedMode": true, - "_useGrayscale": false, - "_atlas": null, - "_id": "" - }, - { - "__type__": "cc.CompPrefabInfo", - "fileId": "63fJkyacRL+7WAfqYIkEL6" - }, - { - "__type__": "cc.PrefabInfo", - "root": { - "__id__": 1 - }, - "asset": { - "__id__": 0 - }, - "fileId": "b3a6gc+YlJhItiIGL9tVv7", - "instance": null, - "targetOverrides": null, - "nestedPrefabInstanceRoots": null - }, - { - "__type__": "cc.Node", - "_name": "Btn_Confirm", - "_objFlags": 0, - "__editorExtras__": {}, - "_parent": { - "__id__": 12 - }, - "_children": [], - "_active": true, - "_components": [ - { - "__id__": 32 - }, - { - "__id__": 34 - } - ], - "_prefab": { - "__id__": 36 - }, - "_lpos": { - "__type__": "cc.Vec3", - "x": 200, - "y": -155, - "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__": 31 - }, - "_enabled": true, - "__prefab": { - "__id__": 33 - }, "_contentSize": { "__type__": "cc.Size", "width": 287, @@ -847,11 +708,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 31 + "__id__": 25 }, "_enabled": true, "__prefab": { - "__id__": 35 + "__id__": 29 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -914,17 +775,17 @@ "_active": true, "_components": [ { - "__id__": 38 + "__id__": 32 }, { - "__id__": 40 + "__id__": 34 }, { - "__id__": 42 + "__id__": 36 } ], "_prefab": { - "__id__": 44 + "__id__": 38 }, "_lpos": { "__type__": "cc.Vec3", @@ -961,11 +822,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 37 + "__id__": 31 }, "_enabled": true, "__prefab": { - "__id__": 39 + "__id__": 33 }, "_contentSize": { "__type__": "cc.Size", @@ -989,11 +850,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 37 + "__id__": 31 }, "_enabled": true, "__prefab": { - "__id__": 41 + "__id__": 35 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -1060,11 +921,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 37 + "__id__": 31 }, "_enabled": true, "__prefab": { - "__id__": 43 + "__id__": 37 }, "_key": "AID_QUIT_RIGHT_BUTTON", "_id": "" @@ -1098,14 +959,14 @@ "_active": true, "_components": [ { - "__id__": 46 + "__id__": 40 }, { - "__id__": 48 + "__id__": 42 } ], "_prefab": { - "__id__": 50 + "__id__": 44 }, "_lpos": { "__type__": "cc.Vec3", @@ -1142,11 +1003,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 45 + "__id__": 39 }, "_enabled": true, "__prefab": { - "__id__": 47 + "__id__": 41 }, "_contentSize": { "__type__": "cc.Size", @@ -1170,11 +1031,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 45 + "__id__": 39 }, "_enabled": true, "__prefab": { - "__id__": 49 + "__id__": 43 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -1237,17 +1098,17 @@ "_active": true, "_components": [ { - "__id__": 52 + "__id__": 46 }, { - "__id__": 54 + "__id__": 48 }, { - "__id__": 56 + "__id__": 50 } ], "_prefab": { - "__id__": 58 + "__id__": 52 }, "_lpos": { "__type__": "cc.Vec3", @@ -1284,11 +1145,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 51 + "__id__": 45 }, "_enabled": true, "__prefab": { - "__id__": 53 + "__id__": 47 }, "_contentSize": { "__type__": "cc.Size", @@ -1312,11 +1173,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 51 + "__id__": 45 }, "_enabled": true, "__prefab": { - "__id__": 55 + "__id__": 49 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -1383,11 +1244,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 51 + "__id__": 45 }, "_enabled": true, "__prefab": { - "__id__": 57 + "__id__": 51 }, "_key": "AID_QUIT_LEFT_BUTTON", "_id": "" @@ -1421,14 +1282,14 @@ "_active": true, "_components": [ { - "__id__": 60 + "__id__": 54 }, { - "__id__": 62 + "__id__": 56 } ], "_prefab": { - "__id__": 64 + "__id__": 58 }, "_lpos": { "__type__": "cc.Vec3", @@ -1465,11 +1326,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 59 + "__id__": 53 }, "_enabled": true, "__prefab": { - "__id__": 61 + "__id__": 55 }, "_contentSize": { "__type__": "cc.Size", @@ -1493,11 +1354,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 59 + "__id__": 53 }, "_enabled": true, "__prefab": { - "__id__": 63 + "__id__": 57 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -1560,17 +1421,17 @@ "_active": true, "_components": [ { - "__id__": 66 + "__id__": 60 }, { - "__id__": 68 + "__id__": 62 }, { - "__id__": 70 + "__id__": 64 } ], "_prefab": { - "__id__": 72 + "__id__": 66 }, "_lpos": { "__type__": "cc.Vec3", @@ -1607,11 +1468,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 65 + "__id__": 59 }, "_enabled": true, "__prefab": { - "__id__": 67 + "__id__": 61 }, "_contentSize": { "__type__": "cc.Size", @@ -1635,11 +1496,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 65 + "__id__": 59 }, "_enabled": true, "__prefab": { - "__id__": 69 + "__id__": 63 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -1706,11 +1567,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 65 + "__id__": 59 }, "_enabled": true, "__prefab": { - "__id__": 71 + "__id__": 65 }, "_key": "AID_QUIT_LEFT_BUTTON", "_id": "" @@ -1744,14 +1605,14 @@ "_active": true, "_components": [ { - "__id__": 74 + "__id__": 68 }, { - "__id__": 76 + "__id__": 70 } ], "_prefab": { - "__id__": 78 + "__id__": 72 }, "_lpos": { "__type__": "cc.Vec3", @@ -1788,11 +1649,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 73 + "__id__": 67 }, "_enabled": true, "__prefab": { - "__id__": 75 + "__id__": 69 }, "_contentSize": { "__type__": "cc.Size", @@ -1816,11 +1677,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 73 + "__id__": 67 }, "_enabled": true, "__prefab": { - "__id__": 77 + "__id__": 71 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -1906,14 +1767,14 @@ "_active": true, "_components": [ { - "__id__": 80 + "__id__": 74 }, { - "__id__": 82 + "__id__": 76 } ], "_prefab": { - "__id__": 84 + "__id__": 78 }, "_lpos": { "__type__": "cc.Vec3", @@ -1950,11 +1811,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 79 + "__id__": 73 }, "_enabled": true, "__prefab": { - "__id__": 81 + "__id__": 75 }, "_contentSize": { "__type__": "cc.Size", @@ -1978,11 +1839,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 79 + "__id__": 73 }, "_enabled": true, "__prefab": { - "__id__": 83 + "__id__": 77 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -2066,7 +1927,7 @@ }, "_enabled": true, "__prefab": { - "__id__": 86 + "__id__": 80 }, "_contentSize": { "__type__": "cc.Size", @@ -2094,7 +1955,7 @@ }, "_enabled": true, "__prefab": { - "__id__": 88 + "__id__": 82 }, "_alignFlags": 45, "_target": null, @@ -2143,7 +2004,7 @@ }, "_enabled": true, "__prefab": { - "__id__": 91 + "__id__": 85 }, "_contentSize": { "__type__": "cc.Size", @@ -2171,7 +2032,7 @@ }, "_enabled": true, "__prefab": { - "__id__": 93 + "__id__": 87 }, "_alignFlags": 45, "_target": null, @@ -2207,7 +2068,7 @@ }, "_enabled": true, "__prefab": { - "__id__": 95 + "__id__": 89 }, "_id": "" }, diff --git a/assets/Game/scripts/game/TipPanel.ts b/assets/Game/scripts/game/TipPanel.ts index 1f41ee8..4725bfe 100644 --- a/assets/Game/scripts/game/TipPanel.ts +++ b/assets/Game/scripts/game/TipPanel.ts @@ -16,7 +16,7 @@ export class TipPanel extends Component { tipNode: Node = null; messageNode: Node = null; - hasTip:boolean = false; + hasTip: boolean = false; /** @@ -29,9 +29,9 @@ export class TipPanel extends Component { * @param cancelStr 取消按钮文本 * @param hasCancel 是否显示取消按钮 */ - showTip(title: string, msg: string, callback?: Function, cancelCallback?: Function, confirmStr?: string, cancelStr?: string, hasCancel: boolean = true) { + showTip(title: string, msg: string, callback?: Function, cancelCallback?: Function, confirmStr?: string, cancelStr?: string, hasCancel: boolean = true) { // 从对象池获取提示框节点 - this.tipNode = NodePoolManager.instance.getNodeFromPoolStatic('TipMessagePanel', this.tipPrefab); + this.tipNode = NodePoolManager.instance.getNodeFromPoolStatic('TipMessagePanel', this.tipPrefab); // 设置标题和消息 let message = this.tipNode.getChildByName('message'); this.messageNode = message; @@ -129,14 +129,6 @@ export class TipPanel extends Component { .start(); }); } - - // 添加关闭按钮点击事件 - let closeBtn = message.getChildByName('Btn_Close_A'); - closeBtn.on(Node.EventType.TOUCH_END, () => { - if (this.isAnimating) return; - AudioManager.instance.playSFX('Common_Button_Click'); - this.closeTip(); - }); } // 回收节点 @@ -146,7 +138,6 @@ export class TipPanel extends Component { this.messageNode.getChildByName('Btn_Confirm').off(Node.EventType.TOUCH_END); this.messageNode.getChildByName('Btn_Cancel').off(Node.EventType.TOUCH_END); this.messageNode.getChildByName('Btn_Confirm_1').off(Node.EventType.TOUCH_END); - this.messageNode.getChildByName('Btn_Close_A').off(Node.EventType.TOUCH_END); // 回收节点 NodePoolManager.instance.putNodeToPool('TipMessagePanel', this.tipNode); }