|
@@ -156,6 +156,7 @@ cc.Class({
|
|
|
|
|
|
//设置初始预加载的子游戏
|
|
//设置初始预加载的子游戏
|
|
initPreSubGame(){
|
|
initPreSubGame(){
|
|
|
|
+ /*
|
|
//临时生成节点
|
|
//临时生成节点
|
|
let tnode = new cc.Node('lab');
|
|
let tnode = new cc.Node('lab');
|
|
tnode.setPosition(-521, 272);
|
|
tnode.setPosition(-521, 272);
|
|
@@ -169,6 +170,7 @@ cc.Class({
|
|
tnode2.addComponent(cc.Label);
|
|
tnode2.addComponent(cc.Label);
|
|
tnode2.getComponent(cc.Label).fontSize = 30;
|
|
tnode2.getComponent(cc.Label).fontSize = 30;
|
|
tnode2.parent = this.node;
|
|
tnode2.parent = this.node;
|
|
|
|
+ */
|
|
|
|
|
|
|
|
|
|
let obj = [
|
|
let obj = [
|
|
@@ -672,7 +674,7 @@ cc.Class({
|
|
if(!bContain){ //当前进入的子游戏不在预加载子游戏列表中
|
|
if(!bContain){ //当前进入的子游戏不在预加载子游戏列表中
|
|
//移除权重最低的子游戏
|
|
//移除权重最低的子游戏
|
|
let tempName = config[preArr[0].kindID].bundle;
|
|
let tempName = config[preArr[0].kindID].bundle;
|
|
- this.node.getChildByName('lab2').getComponent(cc.Label).string ='移除bundle: ' + tempName;
|
|
|
|
|
|
+ // this.node.getChildByName('lab2').getComponent(cc.Label).string ='移除bundle: ' + tempName;
|
|
let bundle = cc.assetManager.getBundle(tempName);
|
|
let bundle = cc.assetManager.getBundle(tempName);
|
|
if(bundle){
|
|
if(bundle){
|
|
// window.nowBundle = null;
|
|
// window.nowBundle = null;
|
|
@@ -684,7 +686,7 @@ cc.Class({
|
|
preArr[0].kindID = optdata.KindID; //给移除的bundle重新赋值
|
|
preArr[0].kindID = optdata.KindID; //给移除的bundle重新赋值
|
|
preArr[0].weight = 30;
|
|
preArr[0].weight = 30;
|
|
}
|
|
}
|
|
- this.node.getChildByName('lab').getComponent(cc.Label).string =`当前bundle: ${config[preArr[0].kindID].bundle}:${preArr[0].weight}, ${config[preArr[1].kindID].bundle}:${preArr[1].weight}, ${ config[preArr[2].kindID].bundle}:${preArr[2].weight}`;
|
|
|
|
|
|
+ // this.node.getChildByName('lab').getComponent(cc.Label).string =`当前bundle: ${config[preArr[0].kindID].bundle}:${preArr[0].weight}, ${config[preArr[1].kindID].bundle}:${preArr[1].weight}, ${ config[preArr[2].kindID].bundle}:${preArr[2].weight}`;
|
|
//修改本地缓存
|
|
//修改本地缓存
|
|
let str = JSON.stringify(preArr);
|
|
let str = JSON.stringify(preArr);
|
|
Global.setLocalStorageVaule("preSubGames", str);
|
|
Global.setLocalStorageVaule("preSubGames", str);
|