UI修改,暂停弹窗增加

This commit is contained in:
computer\尼卡 2025-07-08 16:35:25 +08:00
parent 0b9f05f77f
commit 94f976b1f9
9 changed files with 2613 additions and 578 deletions

File diff suppressed because it is too large Load Diff

View File

@ -5876,6 +5876,7 @@
"vibrate": {
"__id__": 109
},
"exit": null,
"_id": "09T1CBxRNLYrp9d2cfApFS"
},
{

View File

@ -5,6 +5,9 @@
// Learn life-cycle callbacks:
// - https://docs.cocos.com/creator/manual/en/scripting/life-cycle-callbacks.html
import JiaZai from "./JiaZai";
import SceneManager from "./SceneManager";
const { ccclass, property } = cc._decorator;
@ -23,8 +26,8 @@ export default class setUi extends cc.Component {
@property(cc.Node)
vibrate: cc.Node = null;
// mapInfo: number[][] = [];
@property(cc.Node)
exit: cc.Node = null;
musicState: boolean = true;
effectState: boolean = true;
@ -53,9 +56,6 @@ export default class setUi extends cc.Component {
start() {
}
init(time) {
}
clickMusic() {
if (this.musicState) {
@ -129,6 +129,26 @@ export default class setUi extends cc.Component {
}
//退出游戏
clickExit() {
this.exit.active = true;
}
//取消
cancelExit() {
this.exit.active = false;
// 获取场景中的 pause 组件
// const pauseTs = cc.find("Canvas");
// if (pauseTs) {
// const pause = pauseTs.getComponent(SceneManager);
// if (pause) {
// pause.closePause();
// } else {
// console.warn("pause 组件未找到");
// }
// } else {
// console.warn("pause 节点未找到");
// }
}
//关闭ui
closeUi() {
cc.fx.AudioManager._instance.playEffect("anniu_little", null);

View File

@ -15,7 +15,7 @@
<key>spriteSourceSize</key>
<string>{281,71}</string>
<key>textureRect</key>
<string>{{552,695},{281,71}}</string>
<string>{{0,300},{281,71}}</string>
<key>textureRotated</key>
<false/>
</dict>
@ -30,9 +30,9 @@
<key>spriteSourceSize</key>
<string>{255,70}</string>
<key>textureRect</key>
<string>{{1897,551},{255,70}}</string>
<string>{{1394,230},{255,70}}</string>
<key>textureRotated</key>
<true/>
<false/>
</dict>
<key>30miao.png</key>
<dict>
@ -45,7 +45,7 @@
<key>spriteSourceSize</key>
<string>{255,70}</string>
<key>textureRect</key>
<string>{{1550,710},{255,70}}</string>
<string>{{1649,230},{255,70}}</string>
<key>textureRotated</key>
<false/>
</dict>
@ -60,7 +60,7 @@
<key>spriteSourceSize</key>
<string>{76,82}</string>
<key>textureRect</key>
<string>{{1913,1},{76,82}}</string>
<string>{{1118,300},{76,82}}</string>
<key>textureRotated</key>
<false/>
</dict>
@ -75,9 +75,9 @@
<key>spriteSourceSize</key>
<string>{636,174}</string>
<key>textureRect</key>
<string>{{365,1},{636,174}}</string>
<string>{{616,968},{636,174}}</string>
<key>textureRotated</key>
<true/>
<false/>
</dict>
<key>baozha.png</key>
<dict>
@ -90,9 +90,9 @@
<key>spriteSourceSize</key>
<string>{348,66}</string>
<key>textureRect</key>
<string>{{333,769},{348,66}}</string>
<string>{{689,230},{348,66}}</string>
<key>textureRotated</key>
<true/>
<false/>
</dict>
<key>bgl.png</key>
<dict>
@ -105,9 +105,9 @@
<key>spriteSourceSize</key>
<string>{154,172}</string>
<key>textureRect</key>
<string>{{1653,839},{154,172}}</string>
<string>{{0,968},{154,172}}</string>
<key>textureRotated</key>
<true/>
<false/>
</dict>
<key>chubuqule.png</key>
<dict>
@ -120,37 +120,37 @@
<key>spriteSourceSize</key>
<string>{281,64}</string>
<key>textureRect</key>
<string>{{1239,1037},{281,64}}</string>
<string>{{898,166},{281,64}}</string>
<key>textureRotated</key>
<true/>
<false/>
</dict>
<key>chuizi.png</key>
<dict>
<key>aliases</key>
<array/>
<key>spriteOffset</key>
<string>{-1,0}</string>
<string>{0,0}</string>
<key>spriteSize</key>
<string>{306,316}</string>
<string>{316,316}</string>
<key>spriteSourceSize</key>
<string>{316,316}</string>
<key>textureRect</key>
<string>{{1589,67},{306,316}}</string>
<string>{{646,1340},{316,316}}</string>
<key>textureRotated</key>
<true/>
<false/>
</dict>
<key>chuizis.png</key>
<dict>
<key>aliases</key>
<array/>
<key>spriteOffset</key>
<string>{0,1}</string>
<string>{0,0}</string>
<key>spriteSize</key>
<string>{126,132}</string>
<string>{150,150}</string>
<key>spriteSourceSize</key>
<string>{150,150}</string>
<key>textureRect</key>
<string>{{1467,1182},{126,132}}</string>
<string>{{1736,654},{150,150}}</string>
<key>textureRotated</key>
<false/>
</dict>
@ -159,13 +159,13 @@
<key>aliases</key>
<array/>
<key>spriteOffset</key>
<string>{-1,0}</string>
<string>{0,0}</string>
<key>spriteSize</key>
<string>{238,284}</string>
<string>{284,284}</string>
<key>spriteSourceSize</key>
<string>{284,284}</string>
<key>textureRect</key>
<string>{{933,1037},{238,284}}</string>
<string>{{362,1340},{284,284}}</string>
<key>textureRotated</key>
<false/>
</dict>
@ -180,7 +180,7 @@
<key>spriteSourceSize</key>
<string>{80,100}</string>
<key>textureRect</key>
<string>{{1907,85},{80,100}}</string>
<string>{{0,398},{80,100}}</string>
<key>textureRotated</key>
<false/>
</dict>
@ -195,9 +195,9 @@
<key>spriteSourceSize</key>
<string>{264,104}</string>
<key>textureRect</key>
<string>{{1305,1037},{264,104}}</string>
<string>{{1007,398},{264,104}}</string>
<key>textureRotated</key>
<true/>
<false/>
</dict>
<key>closet.png</key>
<dict>
@ -210,7 +210,7 @@
<key>spriteSourceSize</key>
<string>{66,66}</string>
<key>textureRect</key>
<string>{{1807,710},{66,66}}</string>
<string>{{1037,230},{66,66}}</string>
<key>textureRotated</key>
<false/>
</dict>
@ -225,7 +225,7 @@
<key>spriteSourceSize</key>
<string>{312,62}</string>
<key>textureRect</key>
<string>{{1060,583},{312,62}}</string>
<string>{{586,166},{312,62}}</string>
<key>textureRotated</key>
<false/>
</dict>
@ -236,13 +236,13 @@
<key>spriteOffset</key>
<string>{0,0}</string>
<key>spriteSize</key>
<string>{70,71}</string>
<string>{86,98}</string>
<key>spriteSourceSize</key>
<string>{70,71}</string>
<string>{86,98}</string>
<key>textureRect</key>
<string>{{1897,479},{70,71}}</string>
<string>{{1822,300},{86,98}}</string>
<key>textureRotated</key>
<true/>
<false/>
</dict>
<key>coins4.png</key>
<dict>
@ -255,7 +255,7 @@
<key>spriteSourceSize</key>
<string>{171,191}</string>
<key>textureRect</key>
<string>{{662,958},{171,191}}</string>
<string>{{1272,1142},{171,191}}</string>
<key>textureRotated</key>
<false/>
</dict>
@ -270,7 +270,7 @@
<key>spriteSourceSize</key>
<string>{58,64}</string>
<key>textureRect</key>
<string>{{933,965},{58,64}}</string>
<string>{{1179,166},{58,64}}</string>
<key>textureRotated</key>
<false/>
</dict>
@ -285,7 +285,7 @@
<key>spriteSourceSize</key>
<string>{234,36}</string>
<key>textureRect</key>
<string>{{167,1281},{234,36}}</string>
<string>{{109,0},{234,36}}</string>
<key>textureRotated</key>
<false/>
</dict>
@ -300,24 +300,24 @@
<key>spriteSourceSize</key>
<string>{802,118}</string>
<key>textureRect</key>
<string>{{1,1},{802,118}}</string>
<string>{{314,514},{802,118}}</string>
<key>textureRotated</key>
<true/>
<false/>
</dict>
<key>door.png</key>
<dict>
<key>aliases</key>
<array/>
<key>spriteOffset</key>
<string>{0,1}</string>
<string>{0,0}</string>
<key>spriteSize</key>
<string>{616,96}</string>
<string>{616,100}</string>
<key>spriteSourceSize</key>
<string>{616,100}</string>
<key>textureRect</key>
<string>{{835,695},{616,96}}</string>
<string>{{80,398},{616,100}}</string>
<key>textureRotated</key>
<true/>
<false/>
</dict>
<key>doudakai.png</key>
<dict>
@ -330,7 +330,7 @@
<key>spriteSourceSize</key>
<string>{322,64}</string>
<key>textureRect</key>
<string>{{1589,1},{322,64}}</string>
<string>{{1237,166},{322,64}}</string>
<key>textureRotated</key>
<false/>
</dict>
@ -345,7 +345,22 @@
<key>spriteSourceSize</key>
<string>{144,164}</string>
<key>textureRect</key>
<string>{{662,1151},{144,164}}</string>
<string>{{150,804},{144,164}}</string>
<key>textureRotated</key>
<false/>
</dict>
<key>fangqi.png</key>
<dict>
<key>aliases</key>
<array/>
<key>spriteOffset</key>
<string>{0,0}</string>
<key>spriteSize</key>
<string>{291,66}</string>
<key>spriteSourceSize</key>
<string>{291,66}</string>
<key>textureRect</key>
<string>{{1103,230},{291,66}}</string>
<key>textureRotated</key>
<false/>
</dict>
@ -360,9 +375,9 @@
<key>spriteSourceSize</key>
<string>{434,144}</string>
<key>textureRect</key>
<string>{{950,1},{434,144}}</string>
<string>{{0,654},{434,144}}</string>
<key>textureRotated</key>
<true/>
<false/>
</dict>
<key>giveup.png</key>
<dict>
@ -375,7 +390,7 @@
<key>spriteSourceSize</key>
<string>{434,144}</string>
<key>textureRect</key>
<string>{{950,437},{434,144}}</string>
<string>{{434,654},{434,144}}</string>
<key>textureRotated</key>
<false/>
</dict>
@ -390,9 +405,9 @@
<key>spriteSourceSize</key>
<string>{476,164}</string>
<key>textureRect</key>
<string>{{167,803},{476,164}}</string>
<string>{{294,804},{476,164}}</string>
<key>textureRotated</key>
<true/>
<false/>
</dict>
<key>guide.png</key>
<dict>
@ -405,7 +420,7 @@
<key>spriteSourceSize</key>
<string>{174,236}</string>
<key>textureRect</key>
<string>{{1405,343},{174,236}}</string>
<string>{{188,1340},{174,236}}</string>
<key>textureRotated</key>
<false/>
</dict>
@ -420,9 +435,9 @@
<key>spriteSourceSize</key>
<string>{412,65}</string>
<key>textureRect</key>
<string>{{1242,1},{412,65}}</string>
<string>{{0,230},{412,65}}</string>
<key>textureRotated</key>
<true/>
<false/>
</dict>
<key>houhuifu.png</key>
<dict>
@ -435,9 +450,24 @@
<key>spriteSourceSize</key>
<string>{289,54}</string>
<key>textureRect</key>
<string>{{1411,1026},{289,54}}</string>
<string>{{1539,0},{289,54}}</string>
<key>textureRotated</key>
<true/>
<false/>
</dict>
<key>hpme.png</key>
<dict>
<key>aliases</key>
<array/>
<key>spriteOffset</key>
<string>{0,0}</string>
<key>spriteSize</key>
<string>{586,57}</string>
<key>spriteSourceSize</key>
<string>{586,57}</string>
<key>textureRect</key>
<string>{{766,109},{586,57}}</string>
<key>textureRotated</key>
<false/>
</dict>
<key>huifuyidian.png</key>
<dict>
@ -450,7 +480,7 @@
<key>spriteSourceSize</key>
<string>{561,54}</string>
<key>textureRect</key>
<string>{{365,639},{561,54}}</string>
<string>{{0,54},{561,54}}</string>
<key>textureRotated</key>
<false/>
</dict>
@ -459,30 +489,30 @@
<key>aliases</key>
<array/>
<key>spriteOffset</key>
<string>{0,1}</string>
<string>{0,0}</string>
<key>spriteSize</key>
<string>{242,294}</string>
<string>{316,316}</string>
<key>spriteSourceSize</key>
<string>{316,316}</string>
<key>textureRect</key>
<string>{{1357,782},{242,294}}</string>
<string>{{962,1340},{316,316}}</string>
<key>textureRotated</key>
<true/>
<false/>
</dict>
<key>ices.png</key>
<dict>
<key>aliases</key>
<array/>
<key>spriteOffset</key>
<string>{0,1}</string>
<string>{0,0}</string>
<key>spriteSize</key>
<string>{108,130}</string>
<string>{150,150}</string>
<key>spriteSourceSize</key>
<string>{150,150}</string>
<key>textureRect</key>
<string>{{928,585},{108,130}}</string>
<string>{{1886,654},{150,150}}</string>
<key>textureRotated</key>
<true/>
<false/>
</dict>
<key>jianshao.png</key>
<dict>
@ -495,9 +525,24 @@
<key>spriteSourceSize</key>
<string>{363,57}</string>
<key>textureRect</key>
<string>{{603,958},{363,57}}</string>
<string>{{1352,109},{363,57}}</string>
<key>textureRotated</key>
<true/>
<false/>
</dict>
<key>jianshaohp.png</key>
<dict>
<key>aliases</key>
<array/>
<key>spriteOffset</key>
<string>{0,0}</string>
<key>spriteSize</key>
<string>{586,57}</string>
<key>spriteSourceSize</key>
<string>{586,57}</string>
<key>textureRect</key>
<string>{{0,166},{586,57}}</string>
<key>textureRotated</key>
<false/>
</dict>
<key>jinruguanqiaq.png</key>
<dict>
@ -510,9 +555,9 @@
<key>spriteSourceSize</key>
<string>{516,164}</string>
<key>textureRect</key>
<string>{{1,805},{516,164}}</string>
<string>{{770,804},{516,164}}</string>
<key>textureRotated</key>
<true/>
<false/>
</dict>
<key>jixu.png</key>
<dict>
@ -525,9 +570,9 @@
<key>spriteSourceSize</key>
<string>{476,164}</string>
<key>textureRect</key>
<string>{{167,803},{476,164}}</string>
<string>{{1286,804},{476,164}}</string>
<key>textureRotated</key>
<true/>
<false/>
</dict>
<key>kuang.png.jpg</key>
<dict>
@ -540,7 +585,7 @@
<key>spriteSourceSize</key>
<string>{314,96}</string>
<key>textureRect</key>
<string>{{1581,494},{314,96}}</string>
<string>{{1194,300},{314,96}}</string>
<key>textureRotated</key>
<false/>
</dict>
@ -555,9 +600,9 @@
<key>spriteSourceSize</key>
<string>{154,172}</string>
<key>textureRect</key>
<string>{{1653,995},{154,172}}</string>
<string>{{154,968},{154,172}}</string>
<key>textureRotated</key>
<true/>
<false/>
</dict>
<key>lockzi.png</key>
<dict>
@ -570,7 +615,7 @@
<key>spriteSourceSize</key>
<string>{109,32}</string>
<key>textureRect</key>
<string>{{165,769},{109,32}}</string>
<string>{{0,0},{109,32}}</string>
<key>textureRotated</key>
<false/>
</dict>
@ -585,9 +630,9 @@
<key>spriteSourceSize</key>
<string>{158,44}</string>
<key>textureRect</key>
<string>{{333,1119},{158,44}}</string>
<string>{{1381,0},{158,44}}</string>
<key>textureRotated</key>
<true/>
<false/>
</dict>
<key>nali.png</key>
<dict>
@ -600,9 +645,9 @@
<key>spriteSourceSize</key>
<string>{582,55}</string>
<key>textureRect</key>
<string>{{893,1},{582,55}}</string>
<string>{{561,54},{582,55}}</string>
<key>textureRotated</key>
<true/>
<false/>
</dict>
<key>next.png</key>
<dict>
@ -615,9 +660,9 @@
<key>spriteSourceSize</key>
<string>{636,174}</string>
<key>textureRect</key>
<string>{{541,1},{636,174}}</string>
<string>{{1252,968},{636,174}}</string>
<key>textureRotated</key>
<true/>
<false/>
</dict>
<key>ninyihuode.png</key>
<dict>
@ -630,7 +675,7 @@
<key>spriteSourceSize</key>
<string>{189,43}</string>
<key>textureRect</key>
<string>{{1386,581},{189,43}}</string>
<string>{{1192,0},{189,43}}</string>
<key>textureRotated</key>
<false/>
</dict>
@ -645,9 +690,9 @@
<key>spriteSourceSize</key>
<string>{766,56}</string>
<key>textureRect</key>
<string>{{165,1},{766,56}}</string>
<string>{{0,109},{766,56}}</string>
<key>textureRotated</key>
<true/>
<false/>
</dict>
<key>nulldaoju.png</key>
<dict>
@ -660,9 +705,9 @@
<key>spriteSourceSize</key>
<string>{154,172}</string>
<key>textureRect</key>
<string>{{1467,1026},{154,172}}</string>
<string>{{308,968},{154,172}}</string>
<key>textureRotated</key>
<true/>
<false/>
</dict>
<key>open.png</key>
<dict>
@ -675,22 +720,22 @@
<key>spriteSourceSize</key>
<string>{264,104}</string>
<key>textureRect</key>
<string>{{1888,808},{264,104}}</string>
<string>{{1271,398},{264,104}}</string>
<key>textureRotated</key>
<true/>
<false/>
</dict>
<key>pskuang.png</key>
<dict>
<key>aliases</key>
<array/>
<key>spriteOffset</key>
<string>{-155.5,46.5}</string>
<string>{0,0}</string>
<key>spriteSize</key>
<string>{3,3}</string>
<string>{314,96}</string>
<key>spriteSourceSize</key>
<string>{314,96}</string>
<key>textureRect</key>
<string>{{121,780},{3,3}}</string>
<string>{{1508,300},{314,96}}</string>
<key>textureRotated</key>
<false/>
</dict>
@ -705,9 +750,9 @@
<key>spriteSourceSize</key>
<string>{434,144}</string>
<key>textureRect</key>
<string>{{1096,1},{434,144}}</string>
<string>{{868,654},{434,144}}</string>
<key>textureRotated</key>
<true/>
<false/>
</dict>
<key>set.png</key>
<dict>
@ -720,9 +765,9 @@
<key>spriteSourceSize</key>
<string>{154,174}</string>
<key>textureRect</key>
<string>{{1374,626},{154,174}}</string>
<string>{{1888,968},{154,174}}</string>
<key>textureRotated</key>
<true/>
<false/>
</dict>
<key>shijaijndaol.png</key>
<dict>
@ -735,39 +780,39 @@
<key>spriteSourceSize</key>
<string>{283,64}</string>
<key>textureRect</key>
<string>{{1173,1037},{283,64}}</string>
<string>{{1559,166},{283,64}}</string>
<key>textureRotated</key>
<true/>
<false/>
</dict>
<key>starb.png</key>
<dict>
<key>aliases</key>
<array/>
<key>spriteOffset</key>
<string>{8,-7}</string>
<string>{0,0}</string>
<key>spriteSize</key>
<string>{286,300}</string>
<string>{316,316}</string>
<key>spriteSourceSize</key>
<string>{316,316}</string>
<key>textureRect</key>
<string>{{1055,749},{286,300}}</string>
<string>{{1278,1340},{316,316}}</string>
<key>textureRotated</key>
<true/>
<false/>
</dict>
<key>stars.png</key>
<dict>
<key>aliases</key>
<array/>
<key>spriteOffset</key>
<string>{-1,0}</string>
<string>{0,0}</string>
<key>spriteSize</key>
<string>{116,120}</string>
<string>{150,150}</string>
<key>spriteSourceSize</key>
<string>{150,150}</string>
<key>textureRect</key>
<string>{{933,695},{116,120}}</string>
<string>{{0,804},{150,150}}</string>
<key>textureRotated</key>
<true/>
<false/>
</dict>
<key>start.png</key>
<dict>
@ -780,9 +825,24 @@
<key>spriteSourceSize</key>
<string>{520,198}</string>
<key>textureRect</key>
<string>{{403,769},{520,198}}</string>
<string>{{1443,1142},{520,198}}</string>
<key>textureRotated</key>
<true/>
<false/>
</dict>
<key>stay.png</key>
<dict>
<key>aliases</key>
<array/>
<key>spriteOffset</key>
<string>{0,0}</string>
<key>spriteSize</key>
<string>{258,78}</string>
<key>spriteSourceSize</key>
<string>{258,78}</string>
<key>textureRect</key>
<string>{{860,300},{258,78}}</string>
<key>textureRotated</key>
<false/>
</dict>
<key>stop.png</key>
<dict>
@ -795,9 +855,9 @@
<key>spriteSourceSize</key>
<string>{154,172}</string>
<key>textureRect</key>
<string>{{1641,1151},{154,172}}</string>
<string>{{462,968},{154,172}}</string>
<key>textureRotated</key>
<true/>
<false/>
</dict>
<key>stopzi.png</key>
<dict>
@ -810,9 +870,9 @@
<key>spriteSourceSize</key>
<string>{150,65}</string>
<key>textureRect</key>
<string>{{933,813},{150,65}}</string>
<string>{{412,230},{150,65}}</string>
<key>textureRotated</key>
<true/>
<false/>
</dict>
<key>tili.png</key>
<dict>
@ -825,7 +885,7 @@
<key>spriteSourceSize</key>
<string>{127,65}</string>
<key>textureRect</key>
<string>{{1815,1220},{127,65}}</string>
<string>{{562,230},{127,65}}</string>
<key>textureRotated</key>
<false/>
</dict>
@ -840,9 +900,9 @@
<key>spriteSourceSize</key>
<string>{290,73}</string>
<key>textureRect</key>
<string>{{1907,187},{290,73}}</string>
<string>{{570,300},{290,73}}</string>
<key>textureRotated</key>
<true/>
<false/>
</dict>
<key>tiliyiman.png</key>
<dict>
@ -855,7 +915,7 @@
<key>spriteSourceSize</key>
<string>{233,55}</string>
<key>textureRect</key>
<string>{{1653,782},{233,55}}</string>
<string>{{1143,54},{233,55}}</string>
<key>textureRotated</key>
<false/>
</dict>
@ -870,9 +930,9 @@
<key>spriteSourceSize</key>
<string>{777,42}</string>
<key>textureRect</key>
<string>{{121,1},{777,42}}</string>
<string>{{415,0},{777,42}}</string>
<key>textureRotated</key>
<true/>
<false/>
</dict>
<key>touxiang.png</key>
<dict>
@ -885,9 +945,9 @@
<key>spriteSourceSize</key>
<string>{188,198}</string>
<key>textureRect</key>
<string>{{603,768},{188,198}}</string>
<string>{{0,1340},{188,198}}</string>
<key>textureRotated</key>
<true/>
<false/>
</dict>
<key>try.png</key>
<dict>
@ -900,9 +960,9 @@
<key>spriteSourceSize</key>
<string>{636,174}</string>
<key>textureRect</key>
<string>{{717,1},{636,174}}</string>
<string>{{0,1142},{636,174}}</string>
<key>textureRotated</key>
<true/>
<false/>
</dict>
<key>trya.png</key>
<dict>
@ -915,9 +975,39 @@
<key>spriteSourceSize</key>
<string>{144,164}</string>
<key>textureRect</key>
<string>{{1827,1074},{144,164}}</string>
<string>{{1762,804},{144,164}}</string>
<key>textureRotated</key>
<true/>
<false/>
</dict>
<key>tuichu.png</key>
<dict>
<key>aliases</key>
<array/>
<key>spriteOffset</key>
<string>{0,0}</string>
<key>spriteSize</key>
<string>{434,144}</string>
<key>spriteSourceSize</key>
<string>{434,144}</string>
<key>textureRect</key>
<string>{{1302,654},{434,144}}</string>
<key>textureRotated</key>
<false/>
</dict>
<key>xiangxiang.png</key>
<dict>
<key>aliases</key>
<array/>
<key>spriteOffset</key>
<string>{0,0}</string>
<key>spriteSize</key>
<string>{636,174}</string>
<key>spriteSourceSize</key>
<string>{636,174}</string>
<key>textureRect</key>
<string>{{636,1142},{636,174}}</string>
<key>textureRotated</key>
<false/>
</dict>
<key>ximie.png</key>
<dict>
@ -930,9 +1020,9 @@
<key>spriteSourceSize</key>
<string>{692,140}</string>
<key>textureRect</key>
<string>{{223,1},{692,140}}</string>
<string>{{1116,514},{692,140}}</string>
<key>textureRotated</key>
<true/>
<false/>
</dict>
<key>xin.png</key>
<dict>
@ -941,11 +1031,11 @@
<key>spriteOffset</key>
<string>{0,0}</string>
<key>spriteSize</key>
<string>{94,90}</string>
<string>{98,98}</string>
<key>spriteSourceSize</key>
<string>{98,98}</string>
<key>textureRect</key>
<string>{{1309,343},{94,90}}</string>
<string>{{1908,300},{98,98}}</string>
<key>textureRotated</key>
<false/>
</dict>
@ -956,13 +1046,13 @@
<key>spriteOffset</key>
<string>{0,0}</string>
<key>spriteSize</key>
<string>{340,278}</string>
<string>{340,340}</string>
<key>spriteSourceSize</key>
<string>{340,340}</string>
<key>textureRect</key>
<string>{{1309,1},{340,278}}</string>
<string>{{1594,1340},{340,340}}</string>
<key>textureRotated</key>
<true/>
<false/>
</dict>
<key>yichu.png</key>
<dict>
@ -975,7 +1065,7 @@
<key>spriteSourceSize</key>
<string>{289,72}</string>
<key>textureRect</key>
<string>{{223,695},{289,72}}</string>
<string>{{281,300},{289,72}}</string>
<key>textureRotated</key>
<false/>
</dict>
@ -990,9 +1080,9 @@
<key>spriteSourceSize</key>
<string>{72,36}</string>
<key>textureRect</key>
<string>{{514,695},{72,36}}</string>
<string>{{343,0},{72,36}}</string>
<key>textureRotated</key>
<true/>
<false/>
</dict>
<key>yinxiao.png</key>
<dict>
@ -1005,7 +1095,7 @@
<key>spriteSourceSize</key>
<string>{311,116}</string>
<key>textureRect</key>
<string>{{1577,592},{311,116}}</string>
<string>{{1535,398},{311,116}}</string>
<key>textureRotated</key>
<false/>
</dict>
@ -1020,7 +1110,7 @@
<key>spriteSourceSize</key>
<string>{311,100}</string>
<key>textureRect</key>
<string>{{1060,647},{311,100}}</string>
<string>{{696,398},{311,100}}</string>
<key>textureRotated</key>
<false/>
</dict>
@ -1035,7 +1125,7 @@
<key>spriteSourceSize</key>
<string>{314,117}</string>
<key>textureRect</key>
<string>{{1581,375},{314,117}}</string>
<string>{{0,514},{314,117}}</string>
<key>textureRotated</key>
<false/>
</dict>
@ -1051,9 +1141,9 @@
<key>realTextureFileName</key>
<string>gameui.png</string>
<key>size</key>
<string>{1993,1322}</string>
<string>{2042,1680}</string>
<key>smartupdate</key>
<string>$TexturePacker:SmartUpdate:238e38e5565de50e604e9fc7c4082b5e:0d1102846191b2def2aa54cda8c25de2:13103c15d0108e7aab1316a48f90f5be$</string>
<string>$TexturePacker:SmartUpdate:740d3c6571c7cd77c65d7ad2c2b27c90:1aebd3750f8f20dcee2b4ba501126681:13103c15d0108e7aab1316a48f90f5be$</string>
<key>textureFileName</key>
<string>gameui.png</string>
</dict>

File diff suppressed because it is too large Load Diff

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 MiB

After

Width:  |  Height:  |  Size: 987 KiB

View File

@ -8,8 +8,8 @@
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 1993,
"height": 1322,
"width": 2042,
"height": 1680,
"platformSettings": {},
"subMetas": {}
}

View File

@ -33,14 +33,14 @@
"_active": true,
"_components": [
{
"__id__": 321
"__id__": 320
},
{
"__id__": 322
"__id__": 321
}
],
"_prefab": {
"__id__": 323
"__id__": 322
},
"_opacity": 255,
"_color": {
@ -9876,19 +9876,23 @@
"__id__": 272
},
{
"__id__": 279
"__id__": 278
},
{
"__id__": 300
"__id__": 299
},
{
"__id__": 314
"__id__": 312
}
],
"_active": true,
"_components": [],
"_components": [
{
"__id__": 318
}
],
"_prefab": {
"__id__": 320
"__id__": 319
},
"_opacity": 255,
"_color": {
@ -9921,7 +9925,7 @@
1,
1,
1,
1
0
]
},
"_eulerAngles": {
@ -10092,13 +10096,10 @@
"_components": [
{
"__id__": 276
},
{
"__id__": 277
}
],
"_prefab": {
"__id__": 278
"__id__": 277
},
"_opacity": 255,
"_color": {
@ -10123,7 +10124,7 @@
"ctor": "Float64Array",
"array": [
-412.791,
188.252,
111.536,
0,
0,
0,
@ -10288,35 +10289,6 @@
},
"_id": ""
},
{
"__type__": "cc.Widget",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 272
},
"_enabled": false,
"alignMode": 1,
"_target": {
"__id__": 1
},
"_alignFlags": 0,
"_left": 49.716999999999985,
"_right": 327.573,
"_top": 64.18799999999999,
"_bottom": 0,
"_verticalCenter": 0,
"_horizontalCenter": 0,
"_isAbsLeft": true,
"_isAbsRight": true,
"_isAbsTop": true,
"_isAbsBottom": true,
"_isAbsHorizontalCenter": true,
"_isAbsVerticalCenter": true,
"_originalWidth": 188,
"_originalHeight": 0,
"_id": ""
},
{
"__type__": "cc.PrefabInfo",
"root": {
@ -10337,32 +10309,32 @@
},
"_children": [
{
"__id__": 280
"__id__": 279
},
{
"__id__": 283
"__id__": 282
},
{
"__id__": 286
"__id__": 285
},
{
"__id__": 289
"__id__": 288
},
{
"__id__": 292
"__id__": 291
},
{
"__id__": 294
"__id__": 293
}
],
"_active": true,
"_components": [
{
"__id__": 297
"__id__": 296
}
],
"_prefab": {
"__id__": 299
"__id__": 298
},
"_opacity": 255,
"_color": {
@ -10387,7 +10359,7 @@
"ctor": "Float64Array",
"array": [
-81.953,
243.354,
166.638,
0,
0,
0,
@ -10416,17 +10388,17 @@
"_name": "New Sprite",
"_objFlags": 0,
"_parent": {
"__id__": 279
"__id__": 278
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 281
"__id__": 280
}
],
"_prefab": {
"__id__": 282
"__id__": 281
},
"_opacity": 255,
"_color": {
@ -10480,7 +10452,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 280
"__id__": 279
},
"_enabled": true,
"_materials": [
@ -10525,17 +10497,17 @@
"_name": "New Sprite",
"_objFlags": 0,
"_parent": {
"__id__": 279
"__id__": 278
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 284
"__id__": 283
}
],
"_prefab": {
"__id__": 285
"__id__": 284
},
"_opacity": 255,
"_color": {
@ -10589,7 +10561,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 283
"__id__": 282
},
"_enabled": true,
"_materials": [
@ -10634,17 +10606,17 @@
"_name": "New Sprite",
"_objFlags": 0,
"_parent": {
"__id__": 279
"__id__": 278
},
"_children": [],
"_active": false,
"_components": [
{
"__id__": 287
"__id__": 286
}
],
"_prefab": {
"__id__": 288
"__id__": 287
},
"_opacity": 255,
"_color": {
@ -10698,7 +10670,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 286
"__id__": 285
},
"_enabled": true,
"_materials": [
@ -10743,17 +10715,17 @@
"_name": "man",
"_objFlags": 0,
"_parent": {
"__id__": 279
"__id__": 278
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 290
"__id__": 289
}
],
"_prefab": {
"__id__": 291
"__id__": 290
},
"_opacity": 255,
"_color": {
@ -10807,7 +10779,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 289
"__id__": 288
},
"_enabled": true,
"_materials": [
@ -10852,13 +10824,13 @@
"_name": "health",
"_objFlags": 0,
"_parent": {
"__id__": 279
"__id__": 278
},
"_children": [],
"_active": false,
"_components": [],
"_prefab": {
"__id__": 293
"__id__": 292
},
"_opacity": 255,
"_color": {
@ -10923,17 +10895,17 @@
"_name": "time",
"_objFlags": 0,
"_parent": {
"__id__": 279
"__id__": 278
},
"_children": [],
"_active": false,
"_components": [
{
"__id__": 295
"__id__": 294
}
],
"_prefab": {
"__id__": 296
"__id__": 295
},
"_opacity": 255,
"_color": {
@ -10987,7 +10959,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 294
"__id__": 293
},
"_enabled": true,
"_materials": [
@ -11031,16 +11003,16 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 279
"__id__": 278
},
"_enabled": true,
"_enabled": false,
"_normalMaterial": null,
"_grayMaterial": null,
"duration": 0.1,
"zoomScale": 1.1,
"clickEvents": [
{
"__id__": 298
"__id__": 297
}
],
"_N$interactable": true,
@ -11095,9 +11067,7 @@
"_N$hoverSprite": null,
"hoverSprite": null,
"_N$disabledSprite": null,
"_N$target": {
"__id__": 279
},
"_N$target": null,
"_id": ""
},
{
@ -11128,26 +11098,22 @@
},
"_children": [
{
"__id__": 301
"__id__": 300
},
{
"__id__": 304
"__id__": 303
},
{
"__id__": 307
"__id__": 306
},
{
"__id__": 310
"__id__": 309
}
],
"_active": true,
"_components": [
{
"__id__": 312
}
],
"_components": [],
"_prefab": {
"__id__": 313
"__id__": 311
},
"_opacity": 255,
"_color": {
@ -11172,7 +11138,7 @@
"ctor": "Float64Array",
"array": [
335.588,
243.354,
166.638,
0,
0,
0,
@ -11201,17 +11167,17 @@
"_name": "New Sprite",
"_objFlags": 0,
"_parent": {
"__id__": 300
"__id__": 299
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 302
"__id__": 301
}
],
"_prefab": {
"__id__": 303
"__id__": 302
},
"_opacity": 255,
"_color": {
@ -11265,7 +11231,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 301
"__id__": 300
},
"_enabled": true,
"_materials": [
@ -11310,17 +11276,17 @@
"_name": "New Sprite",
"_objFlags": 0,
"_parent": {
"__id__": 300
"__id__": 299
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 305
"__id__": 304
}
],
"_prefab": {
"__id__": 306
"__id__": 305
},
"_opacity": 255,
"_color": {
@ -11374,7 +11340,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 304
"__id__": 303
},
"_enabled": true,
"_materials": [
@ -11419,17 +11385,17 @@
"_name": "New Sprite",
"_objFlags": 0,
"_parent": {
"__id__": 300
"__id__": 299
},
"_children": [],
"_active": false,
"_components": [
{
"__id__": 308
"__id__": 307
}
],
"_prefab": {
"__id__": 309
"__id__": 308
},
"_opacity": 255,
"_color": {
@ -11483,7 +11449,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 307
"__id__": 306
},
"_enabled": true,
"_materials": [
@ -11528,13 +11494,13 @@
"_name": "Coin",
"_objFlags": 0,
"_parent": {
"__id__": 300
"__id__": 299
},
"_children": [],
"_active": true,
"_components": [],
"_prefab": {
"__id__": 311
"__id__": 310
},
"_opacity": 255,
"_color": {
@ -11594,78 +11560,6 @@
"fileId": "abaidugJ1M1Jyqc7VJZvnF",
"sync": false
},
{
"__type__": "cc.Button",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 300
},
"_enabled": false,
"_normalMaterial": null,
"_grayMaterial": null,
"duration": 0.1,
"zoomScale": 1.1,
"clickEvents": [
null
],
"_N$interactable": true,
"_N$enableAutoGrayEffect": false,
"_N$transition": 3,
"transition": 3,
"_N$normalColor": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_N$pressedColor": {
"__type__": "cc.Color",
"r": 211,
"g": 211,
"b": 211,
"a": 255
},
"pressedColor": {
"__type__": "cc.Color",
"r": 211,
"g": 211,
"b": 211,
"a": 255
},
"_N$hoverColor": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"hoverColor": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_N$disabledColor": {
"__type__": "cc.Color",
"r": 124,
"g": 124,
"b": 124,
"a": 255
},
"_N$normalSprite": null,
"_N$pressedSprite": null,
"pressedSprite": null,
"_N$hoverSprite": null,
"hoverSprite": null,
"_N$disabledSprite": null,
"_N$target": {
"__id__": 300
},
"_id": ""
},
{
"__type__": "cc.PrefabInfo",
"root": {
@ -11687,18 +11581,18 @@
"_children": [],
"_active": true,
"_components": [
{
"__id__": 313
},
{
"__id__": 314
},
{
"__id__": 315
},
{
"__id__": 316
},
{
"__id__": 317
}
],
"_prefab": {
"__id__": 319
"__id__": 317
},
"_opacity": 255,
"_color": {
@ -11752,7 +11646,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 314
"__id__": 312
},
"_enabled": true,
"_materials": [
@ -11786,7 +11680,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 314
"__id__": 312
},
"_enabled": true,
"alignMode": 1,
@ -11815,7 +11709,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 314
"__id__": 312
},
"_enabled": true,
"_normalMaterial": null,
@ -11824,7 +11718,7 @@
"zoomScale": 1.2,
"clickEvents": [
{
"__id__": 318
"__id__": 316
}
],
"_N$interactable": true,
@ -11880,7 +11774,7 @@
"hoverSprite": null,
"_N$disabledSprite": null,
"_N$target": {
"__id__": 314
"__id__": 312
},
"_id": ""
},
@ -11905,6 +11799,35 @@
"fileId": "e6/Gg5UhNAkoUU5TcXcEec",
"sync": false
},
{
"__type__": "cc.Widget",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 267
},
"_enabled": true,
"alignMode": 1,
"_target": {
"__id__": 1
},
"_alignFlags": 1,
"_left": 0,
"_right": 0,
"_top": 340.61199999999997,
"_bottom": 0,
"_verticalCenter": 0,
"_horizontalCenter": 0,
"_isAbsLeft": true,
"_isAbsRight": true,
"_isAbsTop": true,
"_isAbsBottom": true,
"_isAbsHorizontalCenter": true,
"_isAbsVerticalCenter": true,
"_originalWidth": 0,
"_originalHeight": 0,
"_id": ""
},
{
"__type__": "cc.PrefabInfo",
"root": {
@ -11931,10 +11854,10 @@
"__id__": 18
},
"coin": {
"__id__": 310
"__id__": 309
},
"Stamina": {
"__id__": 279
"__id__": 278
},
"_id": ""
},

View File

@ -23,7 +23,15 @@ export default class NewClass extends cc.Component {
Stamina: cc.Node = null;
btn_Touch: boolean = true;
private onShowListener: () => void;
private scheduleCallback: Function = null;
private scheduleCallback: Function = null;
private currentCoin: number = 0;
private coinAnimTime: number = 0;
private coinAnimDuration: number = 1.5; // 1.5秒
private coinStart: number = 0;
private coinEnd: number = 0;
private coinAnimating: boolean = false;
private buy: boolean = false;
onLoad() {
this.btn_Touch = true;
// 检测微信小游戏切到后台
@ -71,8 +79,32 @@ export default class NewClass extends cc.Component {
}
}
NumberToImage.numberToImageNodes(cc.fx.GameConfig.GM_INFO.coin, 30, 15, "coin_", this.coin, true);
}
startCoinAnim(target: number) {
if (this.coinAnimating && this.coinEnd === target) return;
this.coinStart = this.currentCoin;
this.coinEnd = target;
this.coinAnimTime = 0;
this.coinAnimating = true;
}
//优化
protected update(dt: number): void {
if (this.coin && this.coinAnimating) {
this.coinAnimTime += dt;
let t = this.coinAnimTime / this.coinAnimDuration;
if (t >= 1) {
this.currentCoin = this.coinEnd;
this.coinAnimating = false;
NumberToImage.numberToImageNodes(this.currentCoin, 30, 15, "coin_", this.coin, true);
} else {
this.currentCoin = Math.floor(this.coinStart + (this.coinEnd - this.coinStart) * t);
NumberToImage.numberToImageNodes(this.currentCoin, 30, 15, "coin_", this.coin, true);
}
}
}
//关闭商店界面
closeShop() {