|
@@ -1,16 +1,19 @@
|
|
|
import { _decorator, assetManager, AudioClip, Component, instantiate, Label, Node, Prefab, resources, SpriteFrame, sys } from 'cc';
|
|
|
-import { server_han_zi_zhao_bu_tong_data, server_mei_nv_zhao_xi_jie_data, server_play_info, server_play_list_data, server_shuang_tu_zhao_bu_tong_data, server_sys_info, server_user_info, unlock_levels, unlock_levels_item } from './data/server_play_list_data';
|
|
|
+import { ads_config, server_han_zi_zhao_bu_tong_data, server_mei_nv_zhao_xi_jie_data, server_play_info, server_play_list_data, server_shuang_tu_zhao_bu_tong_data, server_sys_info, server_user_info, unlock_levels, unlock_levels_item } from './data/server_play_list_data';
|
|
|
import { config } from './config';
|
|
|
import { ClientEvent } from './framework/clientEvent';
|
|
|
import { http } from './http/http';
|
|
|
import { StorageManager } from './framework/storageManager';
|
|
|
import { tools } from './tools';
|
|
|
import { AudioManager } from './framework/audioManager';
|
|
|
+import { Util } from './framework/util';
|
|
|
+import { wait_view } from './wait_view';
|
|
|
const { ccclass, property } = _decorator;
|
|
|
|
|
|
@ccclass('gameManager')
|
|
|
export class gameManager extends Component {
|
|
|
public static g_server_sys_info:server_sys_info = new server_sys_info();
|
|
|
+ public static g_ads_config:ads_config = new ads_config();
|
|
|
public static g_server_play_list_data:server_play_list_data = new server_play_list_data();
|
|
|
// public static g_server_shuang_tu_zhao_bu_tong_data:server_shuang_tu_zhao_bu_tong_data = new server_shuang_tu_zhao_bu_tong_data();
|
|
|
// public static g_server_han_zi_zhao_bu_tong_data:server_han_zi_zhao_bu_tong_data = new server_han_zi_zhao_bu_tong_data();
|
|
@@ -255,8 +258,9 @@ export class gameManager extends Component {
|
|
|
});
|
|
|
}
|
|
|
|
|
|
- public static showWaitView(){
|
|
|
+ public static showWaitView(opacity:number = 0,text:string=""){
|
|
|
gameManager.waitLayer.active = true;
|
|
|
+ gameManager.waitLayer.getComponent(wait_view).showView(opacity,text)
|
|
|
}
|
|
|
public static hideWaitView(){
|
|
|
gameManager.waitLayer.active = false;
|
|
@@ -273,6 +277,7 @@ export class gameManager extends Component {
|
|
|
public static set_server_play_list_data(data:server_play_info){
|
|
|
gameManager.g_server_play_list_data.list = data.wf_list;
|
|
|
gameManager.g_server_sys_info = data.sys_info;
|
|
|
+ gameManager.g_ads_config = data.ads_config;
|
|
|
ClientEvent.dispatchEvent(config.EVENT_MSG.ON_INIT_GAME_LIST);
|
|
|
console.log("set_server_play_list_data::",data);
|
|
|
}
|
|
@@ -575,6 +580,19 @@ export class gameManager extends Component {
|
|
|
},schedule_num)
|
|
|
}
|
|
|
|
|
|
+ public static get_deouble_reward_number():number{
|
|
|
+ let list = gameManager.g_ads_config.reward.split(",");
|
|
|
+ let start = parseInt(list[0]);
|
|
|
+ let end = parseInt(list[1]);
|
|
|
+ let reward = Util.getRandomInt(start,end);
|
|
|
+
|
|
|
+ list = gameManager.g_ads_config.deouble_reward.split(",");
|
|
|
+ start = parseInt(list[0]);
|
|
|
+ end = parseInt(list[1]);
|
|
|
+ reward *= Util.getRandomInt(start,end);
|
|
|
+ return reward;
|
|
|
+ }
|
|
|
+
|
|
|
// public static set_server_han_zi_zhao_bu_tong_data(data){
|
|
|
// gameManager.g_server_han_zi_zhao_bu_tong_data.list = data;
|
|
|
// console.log("set_server_han_zi_zhao_bu_tong_data::",data);
|