|
|
@@ -1,4 +1,5 @@
|
|
|
import JsbSystem from "../../mk/system/JsbSystem";
|
|
|
+import { GameProp } from "../data/GameData";
|
|
|
import FunBtns from "./FunBtns";
|
|
|
|
|
|
const { ccclass, property } = cc._decorator;
|
|
|
@@ -50,7 +51,8 @@ export default class Game extends cc.Component {
|
|
|
this.initInfo();
|
|
|
|
|
|
if(gData.gameData.isNewPlayer()){
|
|
|
- // this.initGuide();
|
|
|
+ this.initGuide();
|
|
|
+ gData.gameData.setProp(GameProp.newPlayer,1);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -61,7 +63,7 @@ export default class Game extends cc.Component {
|
|
|
|
|
|
update() {
|
|
|
if (gData.gameData.init_coin) {
|
|
|
- this.runMoneyAnim();
|
|
|
+ this.initInfo();
|
|
|
}
|
|
|
|
|
|
if (gData.gameData.init_head) {
|
|
|
@@ -69,6 +71,7 @@ export default class Game extends cc.Component {
|
|
|
}
|
|
|
}
|
|
|
lateUpdate() {
|
|
|
+ gData.gameData.init_coin = false;
|
|
|
gData.gameData.init_head = false;
|
|
|
}
|
|
|
|
|
|
@@ -98,24 +101,12 @@ export default class Game extends cc.Component {
|
|
|
private initInfo() {
|
|
|
this.lbl_redMoney.string = gData.gameData.gameData.redMoney + "";
|
|
|
this.lbl_rmb.string = gData.gameData.gameData.piggyBank + "";
|
|
|
- gData.gameData.init_coin = false;
|
|
|
- }
|
|
|
-
|
|
|
- /**
|
|
|
- * 货币变更动画
|
|
|
- */
|
|
|
- private runMoneyAnim() {
|
|
|
- this.lbl_redMoney.getComponent('NumberAnim').setValue(gData.gameData.gameData.redMoney);
|
|
|
- this.lbl_rmb.getComponent('NumberAnim').setValue(gData.gameData.gameData.piggyBank);
|
|
|
- gData.gameData.init_coin = false;
|
|
|
- // gData.gameData.init_coin = false;
|
|
|
}
|
|
|
|
|
|
private async initHead() {
|
|
|
let result = await mk.loader.loadRemote(gData.wechatData.avatar + "?aaa=aa.jpg", null);
|
|
|
this.img_head.spriteFrame = new cc.SpriteFrame(result);
|
|
|
}
|
|
|
-
|
|
|
|
|
|
//测试道具获取效果
|
|
|
private testFly() {
|
|
|
@@ -135,7 +126,6 @@ export default class Game extends cc.Component {
|
|
|
mk.tip.pop("请先点击头像,在设置界面授权");
|
|
|
return;
|
|
|
}
|
|
|
- console.log("=== 分享图片");
|
|
|
JsbSystem.sharePic();
|
|
|
}
|
|
|
}
|