|
@@ -134,6 +134,7 @@ export class gameManager extends Component {
|
|
|
|
|
|
public static add_coin(coin:number){
|
|
|
gameManager.userInfo.coin+=coin;
|
|
|
+ gameManager.sync_data((is_sync)=>{})
|
|
|
}
|
|
|
|
|
|
public static sub_coin(coin:number){
|
|
@@ -141,6 +142,7 @@ export class gameManager extends Component {
|
|
|
if( gameManager.userInfo.coin<0){
|
|
|
gameManager.userInfo.coin = 0;
|
|
|
}
|
|
|
+ gameManager.sync_data((is_sync)=>{})
|
|
|
}
|
|
|
|
|
|
public static showLoading(){
|
|
@@ -173,10 +175,12 @@ export class gameManager extends Component {
|
|
|
let item = gameManager.get_cur_level_by_categoryid(categoryid);
|
|
|
let play_item = gameManager.get_play_list_item_by_categoryid(categoryid);
|
|
|
if(item.level<play_item.barrier_number){
|
|
|
+ item.level+=1;
|
|
|
gameManager.sync_data((is_sync)=>{
|
|
|
if(is_sync){
|
|
|
- item.level+=1;
|
|
|
gameManager.set_unlock_levels_data(item);
|
|
|
+ }else{
|
|
|
+ item.level-=1;
|
|
|
}
|
|
|
call_back(is_sync)
|
|
|
|