import { ryw_Event } from "../../../FrameWork/Event/EventEnum"; import EventMgr from "../../../FrameWork/Event/EventMgr"; import User from "../../../FrameWork/User/User"; import Common5 from "../../../Platform/th/Common5"; import TaskManager from "../../JuQingChat/TaskManager"; import PrefabManage, { GameType } from "../../PrefabManager/PrefabManage"; const {ccclass, property} = cc._decorator; export let WenZiAwardMoney = [ 5000,30000,100000,200000,500000] export let WenZiGuoGuanLevel = [ 50,40,20,5,1 ] @ccclass export default class FirstLevelSelectView2 extends cc.Component { @property(cc.Node) zhaoChaJinDuProgress: cc.Node = null; @property(cc.Node) wenZiJinDuProgress: cc.Node = null; @property(cc.Node) pageNew: cc.Node = null; // LIFE-CYCLE CALLBACKS: // onLoad () {} // curTypeStr = '' start () { EventMgr.onEvent_custom(ryw_Event.updateLevel, () => { this.initView(); }, this) PrefabManage.preloadPrefabByType(GameType.WZ_GameMain) let callFunc = ()=>{ this.initView() } if(!Common5.gameConfig){ cc.loader.loadRes('Json/WenZiGameConfig/WZGameConfig.json', function (err, gameconfig) { if (err) { console.log(err); return; } Common5.gameConfig = gameconfig.json; console.log("文字配置加载成功", Common5.gameConfig); callFunc() }); }else{ callFunc() } } protected onDestroy(): void { // TaskManager.checkIsMainTask520Finish() } initView(){ // Common5.gameConfig.GameAllType[0].Levels = Common5.gameConfig.GameAllType[0].LevelsKangFu // if(typeStr){ // this.curTypeStr = typeStr // } this.pageNew.active= true let successArr = User.getSuccessLevels(); let successNum = 0 // if(this.curTypeStr == 'zhaoCha'){ // }else if(this.curTypeStr == 'wenZi'){ this.zhaoChaJinDuProgress.active = false // this.wenZiJinDuProgress.active = true let arr = Common5.gameConfig.GameAllType[0].Levels for(let i=0;i -1){ successNum++ } } this.wenZiJinDuProgress.getComponent(cc.ProgressBar).progress = successNum/WenZiGuoGuanLevel[0] for(let i=0;i= WenZiGuoGuanLevel[i]){ for(let j=0;j