From c19a6b5316a5dd7461276477a85c20bb7aaa6ee1 Mon Sep 17 00:00:00 2001 From: "pan@work" Date: Wed, 7 Aug 2024 16:21:56 +0800 Subject: [PATCH] dd --- assets/resources/gui/gui/UI-16.png | Bin 0 -> 1252 bytes assets/resources/gui/gui/UI-16.png.meta | 134 ++ assets/resources/gui/gui/UI-17.png | Bin 0 -> 1674 bytes assets/resources/gui/gui/UI-17.png.meta | 134 ++ assets/resources/gui/gui/windws.png.meta | 8 +- .../gui/prefab/role_controller.prefab | 1348 ++++++++++++++++- .../script/game/common/SingletonModuleComp.ts | 7 +- assets/script/game/map/view/MapViewComp.ts | 17 +- 8 files changed, 1577 insertions(+), 71 deletions(-) create mode 100644 assets/resources/gui/gui/UI-16.png create mode 100644 assets/resources/gui/gui/UI-16.png.meta create mode 100644 assets/resources/gui/gui/UI-17.png create mode 100644 assets/resources/gui/gui/UI-17.png.meta diff --git a/assets/resources/gui/gui/UI-16.png b/assets/resources/gui/gui/UI-16.png new file mode 100644 index 0000000000000000000000000000000000000000..47703a8aa896ee47197bc903cf63125ba2c93a7c GIT binary patch literal 1252 zcmV{L)bMB^RyobzN>y>2Q@{B?Vyu7^N>FJ5S`g{QJi9S6%JfQFU zrpY2$h)k_Dq?Bme7G2lf#DFC8cs$~8I8>Jh08&aAV^*0p^$IM`snpV1c3oH9QH2mN z#$cKzv~8R0hq2IFqw6~U)u#i1Z}iC+lf1Zd4pPdM6aX*`L-KkdFveh>=am!ysuF`p zI876@*09#%bULlFYk~A?jDd3wLI|{NTa6gbIVhzt&-0q0`o6CkaEK66N;FLaAq0-c zV>NkP<}^+G>u<&AKhN_kCDP|wpsYmEj0mE&u3|hM$+Xr0uoA==Q_W$t)+-@^g&@;3 ztz~Kr5DBfdYp|12Rw1DfV)Yj(C4jfKtpRRJ|6D~#K?LB2@()@P=L|)}D6LE)#5j&` z)>cZb#3&6;x-FTd!EMHEX{}xLT^d9He{FKw8hW+Xz6x$WvPq$odZR>NxKgS}B&9V- ziCdA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|6+oVc_=Z@WttG9Gs|pY%vJKXS zGuz1TtTQdL7WJ9wWGb_#)#CkYdj# z-%czkitvYQ@L!5~i2t)}Xs0CB_*Qn~9IfNag2t2rTmF~k(!DKY;>cHvt%>|43;d8l zE2NL2b(p1gB+t(+_0$TaI*hC6qC}k~d0`h9nY}T!4~Nd4v%(?hl1bK?9r5!pzT~%3 zwWOEkiaRhnk{1^MB|$jRVjr*iW-VLP;tYBB+>OGyOa8*Oyh2QtgF=16CDr0%TSexp1-i_OX^jk%fa z6|GPVhdGyKLtAI7_1eZ<5SNkssc6#c=-vjQF-KdUV?VU}5gODu;q;SfMhX zQ0jK%o_E*t+V-(oVIB^r)BQnT)rR=w`Qg>2`EmZR=Dq~Zf~jY-$`8Qe#fYBoDr63I z6M18ZpV3|Osk0;}&v(hw1hH=HN4{E-g^c)1rTiLHP%l!dhrf`hyw#SdV%{g;DuCn} zv2loR0mTA8e7zf(p$a4Zcs&kFp!)9O?Mm^^_b;?&F1Y}yTbnqqyDxmh9EU<}{OOWs z8%Wi{W&sn6?%xEm0uH-{HG-n_k{M%&N|PG4a^8x4%B6$F{OTRa6?9>sW2oKO zxf-mI5vJvXUkkLD9huip&edIPZ-09R?B3zycEtAT%Lm3*%)9FM!=Y_2sCj#}6v?wG zE7v=i>X-eneE4sI0)F5RH?`KGc@uke35Dmq{aZ0pE^nL2b{zMG<+ph4y3Xa-zxT+Y zAWqv!@+D}!I`4K4FF!h@sUSRw_%r6gz3UuY=MY9(weeVjoC@4P_}LvGMG(j9)?^b@ zJJLDe_-hZ!`qr7B^nXaU>0)%d9bS%|%`$#lmH7", "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 138 + "__id__": 232 }, "_enabled": true, "__prefab": { - "__id__": 194 + "__id__": 234 }, "_contentSize": { "__type__": "cc.Size", - "width": 100, - "height": 100 + "width": 710, + "height": 15 }, "_anchorPoint": { "__type__": "cc.Vec2", @@ -4395,7 +5362,191 @@ }, { "__type__": "cc.CompPrefabInfo", - "fileId": "f8Wc3CjyVFRKGt3+muqvFx" + "fileId": "37ghf+9y1KibPINSUKT3dB" + }, + { + "__type__": "cc.Sprite", + "_name": "Sprite", + "_objFlags": 0, + "__editorExtras__": {}, + "node": { + "__id__": 232 + }, + "_enabled": true, + "__prefab": { + "__id__": 236 + }, + "_customMaterial": null, + "_srcBlendFactor": 2, + "_dstBlendFactor": 4, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_spriteFrame": { + "__uuid__": "9716cf6d-cc08-452b-8c72-13d63c89aac2@f9941", + "__expectedType__": "cc.SpriteFrame" + }, + "_type": 3, + "_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": "044t35RnVF/YsSKSRZUpom" + }, + { + "__type__": "cc.PrefabInfo", + "root": { + "__id__": 1 + }, + "asset": { + "__id__": 0 + }, + "fileId": "e90jJBsWhE+bTC/rL0g+UF", + "instance": null, + "targetOverrides": null, + "nestedPrefabInstanceRoots": null + }, + { + "__type__": "cc.UITransform", + "_name": "", + "_objFlags": 0, + "__editorExtras__": {}, + "node": { + "__id__": 231 + }, + "_enabled": true, + "__prefab": { + "__id__": 239 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 710, + "height": 15 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0, + "y": 0 + }, + "_id": "" + }, + { + "__type__": "cc.CompPrefabInfo", + "fileId": "20u6NOuwJPfZ5t1CUYnIM1" + }, + { + "__type__": "cc.Sprite", + "_name": "", + "_objFlags": 0, + "__editorExtras__": {}, + "node": { + "__id__": 231 + }, + "_enabled": true, + "__prefab": { + "__id__": 241 + }, + "_customMaterial": null, + "_srcBlendFactor": 2, + "_dstBlendFactor": 4, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_spriteFrame": { + "__uuid__": "eac8f388-79c5-438f-9602-d9bdac7a5d12@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": "6cMZU/pLRNKYFwdlHONJrO" + }, + { + "__type__": "cc.ProgressBar", + "_name": "", + "_objFlags": 0, + "__editorExtras__": {}, + "node": { + "__id__": 231 + }, + "_enabled": true, + "__prefab": { + "__id__": 243 + }, + "_barSprite": { + "__id__": 235 + }, + "_mode": 2, + "_totalLength": 1, + "_progress": 0, + "_reverse": false, + "_id": "" + }, + { + "__type__": "cc.CompPrefabInfo", + "fileId": "fcQdWVTk9EB7j9/1WENjq6" + }, + { + "__type__": "2a50eqI7JZNV5Sh0y/Qd9C6", + "_name": "", + "_objFlags": 0, + "__editorExtras__": {}, + "node": { + "__id__": 231 + }, + "_enabled": true, + "__prefab": { + "__id__": 245 + }, + "controller": false, + "watchPath": "", + "componentName": "cc.ProgressBar", + "componentProperty": "progress", + "refreshRate": 0.1, + "watchPathArr": [ + "data.shuaxin.min", + "data.shuaxin.max" + ], + "stringFormat": "", + "_id": "" + }, + { + "__type__": "cc.CompPrefabInfo", + "fileId": "2aufDK2rtPG7YVEYv7Km03" }, { "__type__": "cc.Widget", @@ -4403,18 +5554,18 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 138 + "__id__": 231 }, "_enabled": true, "__prefab": { - "__id__": 196 + "__id__": 247 }, - "_alignFlags": 12, + "_alignFlags": 4, "_target": null, - "_left": 5, + "_left": 0, "_right": 0, "_top": 0, - "_bottom": 45, + "_bottom": 0, "_horizontalCenter": 0, "_verticalCenter": 0, "_isAbsLeft": true, @@ -4431,7 +5582,7 @@ }, { "__type__": "cc.CompPrefabInfo", - "fileId": "cdqLJH1ixJOLTElVLVR7zr" + "fileId": "0cWeSHLKpP4JnkEQiBgw9E" }, { "__type__": "cc.PrefabInfo", @@ -4441,7 +5592,84 @@ "asset": { "__id__": 0 }, - "fileId": "2bWbBQbDJGYK+P6RpJy4dz", + "fileId": "f12gXQ9bFOkp51/ApkfbD7", + "instance": null, + "targetOverrides": null, + "nestedPrefabInstanceRoots": null + }, + { + "__type__": "cc.UITransform", + "_name": "", + "_objFlags": 0, + "__editorExtras__": {}, + "node": { + "__id__": 230 + }, + "_enabled": true, + "__prefab": { + "__id__": 250 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 1065, + "height": 100 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0, + "y": 0 + }, + "_id": "" + }, + { + "__type__": "cc.CompPrefabInfo", + "fileId": "33jxE1PDJGr6sCHHPiHh90" + }, + { + "__type__": "cc.Widget", + "_name": "", + "_objFlags": 0, + "__editorExtras__": {}, + "node": { + "__id__": 230 + }, + "_enabled": true, + "__prefab": { + "__id__": 252 + }, + "_alignFlags": 44, + "_target": null, + "_left": 5, + "_right": -350, + "_top": 0, + "_bottom": 5, + "_horizontalCenter": 0, + "_verticalCenter": 0, + "_isAbsLeft": true, + "_isAbsRight": true, + "_isAbsTop": true, + "_isAbsBottom": true, + "_isAbsHorizontalCenter": true, + "_isAbsVerticalCenter": true, + "_originalWidth": 100, + "_originalHeight": 0, + "_alignMode": 2, + "_lockFlags": 0, + "_id": "" + }, + { + "__type__": "cc.CompPrefabInfo", + "fileId": "87lTRPigVLdqQlzbF88M+p" + }, + { + "__type__": "cc.PrefabInfo", + "root": { + "__id__": 1 + }, + "asset": { + "__id__": 0 + }, + "fileId": "48c0kP20hBJLGVzQJucqoy", "instance": null, "targetOverrides": null, "nestedPrefabInstanceRoots": null @@ -4456,7 +5684,7 @@ }, "_enabled": true, "__prefab": { - "__id__": 199 + "__id__": 255 }, "_contentSize": { "__type__": "cc.Size", @@ -4484,7 +5712,7 @@ }, "_enabled": true, "__prefab": { - "__id__": 201 + "__id__": 257 }, "_alignFlags": 45, "_target": null, @@ -4520,7 +5748,7 @@ }, "_enabled": true, "__prefab": { - "__id__": 203 + "__id__": 259 }, "_id": "" }, diff --git a/assets/script/game/common/SingletonModuleComp.ts b/assets/script/game/common/SingletonModuleComp.ts index dd97e22f..38637bd1 100644 --- a/assets/script/game/common/SingletonModuleComp.ts +++ b/assets/script/game/common/SingletonModuleComp.ts @@ -38,7 +38,7 @@ export class SingletonModuleComp extends ecs.Comp { /** 下级经验 */ speed : 0, hp: { - min:30, + min:20, max:30 }, power: { @@ -49,6 +49,11 @@ export class SingletonModuleComp extends ecs.Comp { min: 0, max: 10 }, + shuaxin: { + min: 0, + max: 20, + speed:1, + }, }; vmAdd() { diff --git a/assets/script/game/map/view/MapViewComp.ts b/assets/script/game/map/view/MapViewComp.ts index 2544f0c9..3215f9ab 100644 --- a/assets/script/game/map/view/MapViewComp.ts +++ b/assets/script/game/map/view/MapViewComp.ts @@ -28,9 +28,10 @@ export class MapViewComp extends CCComp { onLoad(){ // 监听全局事件 oops.message.on("monster_load", this.onMonsterLoaded, this); + this.addHero(); } private onMonsterLoaded(event: string, args: any) { - console.log('on_monster_load'); + // console.log('on_monster_load'); } reset(): void { @@ -43,16 +44,20 @@ export class MapViewComp extends CCComp { /** 转场 */ protected update(dt: number): void { - if (this.timer.update(dt)) { - // console.log('每2秒触发一次'); - this.addHero(); - } + + this.shuaxin(dt) } private mapLoaded() { } - + shuaxin(dt: number) { + smc.vm_data.shuaxin.min += smc.vm_data.shuaxin.speed*dt; + if (smc.vm_data.shuaxin.min >= smc.vm_data.shuaxin.max) { + smc.vm_data.shuaxin.min = 0; + this.addHero(); + } + } /** 添加玩家 */ private addHero() { this.scene.node.active = true