diff --git a/JisolGameCocos/assets/resources/prefab/ui/Home/HomeView.prefab b/JisolGameCocos/assets/resources/prefab/ui/Home/HomeView.prefab index 15f261cd..bc2969b8 100644 --- a/JisolGameCocos/assets/resources/prefab/ui/Home/HomeView.prefab +++ b/JisolGameCocos/assets/resources/prefab/ui/Home/HomeView.prefab @@ -29,22 +29,25 @@ }, { "__id__": 39 + }, + { + "__id__": 60 } ], "_active": true, "_components": [ { - "__id__": 60 + "__id__": 75 }, { - "__id__": 62 + "__id__": 77 }, { - "__id__": 64 + "__id__": 79 } ], "_prefab": { - "__id__": 66 + "__id__": 81 }, "_lpos": { "__type__": "cc.Vec3", @@ -1411,6 +1414,369 @@ "targetOverrides": null, "nestedPrefabInstanceRoots": null }, + { + "__type__": "cc.Node", + "_name": "Button", + "_objFlags": 0, + "__editorExtras__": {}, + "_parent": { + "__id__": 1 + }, + "_children": [ + { + "__id__": 61 + } + ], + "_active": true, + "_components": [ + { + "__id__": 67 + }, + { + "__id__": 69 + }, + { + "__id__": 71 + } + ], + "_prefab": { + "__id__": 74 + }, + "_lpos": { + "__type__": "cc.Vec3", + "x": 253.94, + "y": 414.543, + "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": "Label", + "_objFlags": 512, + "__editorExtras__": {}, + "_parent": { + "__id__": 60 + }, + "_children": [], + "_active": true, + "_components": [ + { + "__id__": 62 + }, + { + "__id__": 64 + } + ], + "_prefab": { + "__id__": 66 + }, + "_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.UITransform", + "_name": "", + "_objFlags": 0, + "__editorExtras__": {}, + "node": { + "__id__": 61 + }, + "_enabled": true, + "__prefab": { + "__id__": 63 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 100, + "height": 40 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_id": "" + }, + { + "__type__": "cc.CompPrefabInfo", + "fileId": "2bSpfZbFRHvpwnki2RaZ7V" + }, + { + "__type__": "cc.Label", + "_name": "", + "_objFlags": 0, + "__editorExtras__": {}, + "node": { + "__id__": 61 + }, + "_enabled": true, + "__prefab": { + "__id__": 65 + }, + "_customMaterial": null, + "_srcBlendFactor": 2, + "_dstBlendFactor": 4, + "_color": { + "__type__": "cc.Color", + "r": 0, + "g": 0, + "b": 0, + "a": 255 + }, + "_string": "重置", + "_horizontalAlign": 1, + "_verticalAlign": 1, + "_actualFontSize": 20, + "_fontSize": 20, + "_fontFamily": "Arial", + "_lineHeight": 40, + "_overflow": 1, + "_enableWrapText": false, + "_font": null, + "_isSystemFontUsed": true, + "_spacingX": 0, + "_isItalic": false, + "_isBold": false, + "_isUnderline": false, + "_underlineHeight": 2, + "_cacheMode": 0, + "_id": "" + }, + { + "__type__": "cc.CompPrefabInfo", + "fileId": "32geHwtodGZa8v3VxQUJiX" + }, + { + "__type__": "cc.PrefabInfo", + "root": { + "__id__": 1 + }, + "asset": { + "__id__": 0 + }, + "fileId": "7dyiPuQ91LSpN4VBXRTIVK", + "instance": null, + "targetOverrides": null, + "nestedPrefabInstanceRoots": null + }, + { + "__type__": "cc.UITransform", + "_name": "", + "_objFlags": 0, + "__editorExtras__": {}, + "node": { + "__id__": 60 + }, + "_enabled": true, + "__prefab": { + "__id__": 68 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 100, + "height": 40 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_id": "" + }, + { + "__type__": "cc.CompPrefabInfo", + "fileId": "2f6odzsA9CEqdVB6sONuuN" + }, + { + "__type__": "cc.Sprite", + "_name": "", + "_objFlags": 0, + "__editorExtras__": {}, + "node": { + "__id__": 60 + }, + "_enabled": true, + "__prefab": { + "__id__": 70 + }, + "_customMaterial": null, + "_srcBlendFactor": 2, + "_dstBlendFactor": 4, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_spriteFrame": { + "__uuid__": "20835ba4-6145-4fbc-a58a-051ce700aa3e@f9941", + "__expectedType__": "cc.SpriteFrame" + }, + "_type": 1, + "_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": "feJd2oVGZP6os12q4IS28U" + }, + { + "__type__": "cc.Button", + "_name": "", + "_objFlags": 0, + "__editorExtras__": {}, + "node": { + "__id__": 60 + }, + "_enabled": true, + "__prefab": { + "__id__": 72 + }, + "clickEvents": [ + { + "__id__": 73 + } + ], + "_interactable": true, + "_transition": 2, + "_normalColor": { + "__type__": "cc.Color", + "r": 214, + "g": 214, + "b": 214, + "a": 255 + }, + "_hoverColor": { + "__type__": "cc.Color", + "r": 211, + "g": 211, + "b": 211, + "a": 255 + }, + "_pressedColor": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_disabledColor": { + "__type__": "cc.Color", + "r": 124, + "g": 124, + "b": 124, + "a": 255 + }, + "_normalSprite": { + "__uuid__": "20835ba4-6145-4fbc-a58a-051ce700aa3e@f9941", + "__expectedType__": "cc.SpriteFrame" + }, + "_hoverSprite": { + "__uuid__": "20835ba4-6145-4fbc-a58a-051ce700aa3e@f9941", + "__expectedType__": "cc.SpriteFrame" + }, + "_pressedSprite": { + "__uuid__": "544e49d6-3f05-4fa8-9a9e-091f98fc2ce8@f9941", + "__expectedType__": "cc.SpriteFrame" + }, + "_disabledSprite": { + "__uuid__": "951249e0-9f16-456d-8b85-a6ca954da16b@f9941", + "__expectedType__": "cc.SpriteFrame" + }, + "_duration": 0.1, + "_zoomScale": 1.2, + "_target": { + "__id__": 60 + }, + "_id": "" + }, + { + "__type__": "cc.CompPrefabInfo", + "fileId": "b3kouOTZ5EYLw5sMZG324p" + }, + { + "__type__": "cc.ClickEvent", + "target": { + "__id__": 1 + }, + "component": "", + "_componentId": "15051raQgZN6J5ICgY2OfSS", + "handler": "onClickReset", + "customEventData": "" + }, + { + "__type__": "cc.PrefabInfo", + "root": { + "__id__": 1 + }, + "asset": { + "__id__": 0 + }, + "fileId": "4aOUTyOz1Czp5cs51pt4hX", + "instance": null, + "targetOverrides": null, + "nestedPrefabInstanceRoots": null + }, { "__type__": "cc.UITransform", "_name": "", @@ -1421,7 +1787,7 @@ }, "_enabled": true, "__prefab": { - "__id__": 61 + "__id__": 76 }, "_contentSize": { "__type__": "cc.Size", @@ -1449,7 +1815,7 @@ }, "_enabled": true, "__prefab": { - "__id__": 63 + "__id__": 78 }, "_alignFlags": 45, "_target": null, @@ -1485,7 +1851,7 @@ }, "_enabled": true, "__prefab": { - "__id__": 65 + "__id__": 80 }, "frameText": { "__id__": 11 diff --git a/JisolGameCocos/assets/script/ui/Home/HomeView.ts b/JisolGameCocos/assets/script/ui/Home/HomeView.ts index c911b812..b859ff3f 100644 --- a/JisolGameCocos/assets/script/ui/Home/HomeView.ts +++ b/JisolGameCocos/assets/script/ui/Home/HomeView.ts @@ -22,6 +22,7 @@ export class HomeView extends JNGLayerBase { role.input.isRun = data.isChecked; }) } + //设置攻击 setRoleAttack(data){ console.log("攻击",data.isChecked); @@ -30,6 +31,14 @@ export class HomeView extends JNGLayerBase { }) } + //重置 + onClickReset(){ + app.sync.onReset(); + this.scheduleOnce(() => { + app.sync.onStart(); + }); + } + }