Commit 0f73eef7 authored by wildfirecode's avatar wildfirecode

1

parent 459fa35e
......@@ -226,6 +226,7 @@ export default class MainBase extends eui.UILayer {
loadSvga(getResPath() + 'resource/assets/svgas/loading_animals.svga'),
loadSvga(getResPath() + 'resource/assets/svgas/loading_title.svga')
]);
loadSvga(getResPath() + 'resource/assets/svgas/box.svga');
}
catch (e) {
console.error(e);
......
......@@ -112,11 +112,7 @@
</e:Group>
<e:Group id="boxLayer" x="0" y="0" visible="false">
<e:Rect width="750" height="1624" fillAlpha="0.7" x="0" y="0"/>
<e:Group id="boxani" x="19" y="251">
<e:Image id="lightbg" source="光 副本 4_png" y="0" x="0"/>
<e:Image id="boxFrame1" source="宝箱1_png" x="156" y="95"/>
<e:Image id="boxFrame2" source="宝箱2_png" x="69.06" y="32.7"/>
<e:Image id="boxFrame3" source="宝箱3_png" x="68.78" y="-30.72"/>
<e:Group id="boxani">
</e:Group>
</e:Group>
<w:Config id="16c89f4ae1a"/>
......
......@@ -15,6 +15,8 @@ import MapTopPart from "./MapTopPart";
import { readCache, GuideCon } from "./GuideCon";
import { stopGamebg } from "../soundCtrl2";
import setGray from "../setGray";
import { loadSvga } from "../loadSvga";
import getResPath from "../../libs/new_tc/getResPath";
export default class MapScene extends Scene {
scrollGroup: eui.Group;
......@@ -30,6 +32,7 @@ export default class MapScene extends Scene {
if (getBgOn() && MapScene['firstPlayBgTag'] == true) {
playBg();
}
stopGamebg();
if (!readCache()) {
var guide = new GuideCon();
......@@ -289,33 +292,38 @@ export default class MapScene extends Scene {
toggleBg();
}
onTap_boxLayer() {
private _mc;
async onTap_boxLayer() {
NetManager.ins.clickLog(getlogItem(1));
const data = getHomeData();
if (data.canReceiveTreasureBoxNum > 0) {
this['boxLayer'].visible = true;
this['boxFrame1'].visible = true;
this['boxFrame2'].visible = false;
this['boxFrame3'].visible = false;
this._mc = await loadSvga(getResPath() + 'resource/assets/svgas/box.svga', this['boxani']);
this._mc.stop();
this._mc.visible=false;
await wait(50);
this._mc.visible=true;
}
}
async playAni() {
this['boxFrame1'].visible = true;
this['boxFrame2'].visible = false;
this['boxFrame3'].visible = false;
await wait(1000 / 10);
this['boxFrame1'].visible = false;
this['boxFrame2'].visible = true;
this['boxFrame3'].visible = false;
await wait(1000 / 10);
this['boxFrame1'].visible = false;
this['boxFrame2'].visible = false;
this['boxFrame3'].visible = true;
await wait(300);
if (this._mc) {
this._mc.gotoAndPlay(1, true);
await this.onPlaySTOP();
}
this['boxLayer'].visible = false;
}
async onPlaySTOP() {
return new Promise((r) => {
this._mc.once(egret.Event.COMPLETE, () => {
this._mc.stop();
r();
}, this);
});
}
async onTap_box() {
console.log(1)
// const data = getHomeData();
......
......@@ -24,7 +24,7 @@
],
"remainEnargy": 10,
"askForEnergy": false,
"canReceiveTreasureBoxNum": 0,
"canReceiveTreasureBoxNum": 10,
"nextRangeStarsNum": 150
}
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment