complete hot-update without sceneGameLobby
Showing
7 changed files
with
48 additions
and
22 deletions
| ... | @@ -41,8 +41,8 @@ | ... | @@ -41,8 +41,8 @@ |
| 41 | }, | 41 | }, |
| 42 | "_scale": { | 42 | "_scale": { |
| 43 | "__type__": "cc.Vec3", | 43 | "__type__": "cc.Vec3", |
| 44 | "x": 0.37636718749999937, | 44 | "x": 0.3763671875, |
| 45 | "y": 0.37636718749999937, | 45 | "y": 0.3763671875, |
| 46 | "z": 1 | 46 | "z": 1 |
| 47 | }, | 47 | }, |
| 48 | "_quat": { | 48 | "_quat": { |
| ... | @@ -2673,7 +2673,9 @@ | ... | @@ -2673,7 +2673,9 @@ |
| 2673 | "panel": { | 2673 | "panel": { |
| 2674 | "__id__": 61 | 2674 | "__id__": 61 |
| 2675 | }, | 2675 | }, |
| 2676 | "manifestUrl": null, | 2676 | "manifestUrl": { |
| 2677 | "__uuid__": "12f3d277-6912-4388-a876-d91854f39321" | ||
| 2678 | }, | ||
| 2677 | "_id": "dcGJ+cSA5D7qNtScKfLjJJ" | 2679 | "_id": "dcGJ+cSA5D7qNtScKfLjJJ" |
| 2678 | }, | 2680 | }, |
| 2679 | { | 2681 | { | ... | ... |
assets/Scene/sceneGameLobby.fire
deleted
100644 → 0
This diff is collapsed.
Click to expand it.
| ... | @@ -13,14 +13,6 @@ var waterfall_three2six = require('waterfall_three2six'); | ... | @@ -13,14 +13,6 @@ var waterfall_three2six = require('waterfall_three2six'); |
| 13 | 13 | ||
| 14 | //热更新相关 | 14 | //热更新相关 |
| 15 | var UpdatePanel = require('UpdatePanel'); | 15 | var UpdatePanel = require('UpdatePanel'); |
| 16 | var info = cc.Class({ | ||
| 17 | name: 'info', | ||
| 18 | _updating: false, | ||
| 19 | properties: { | ||
| 20 | target: cc.Node, | ||
| 21 | num: 0 | ||
| 22 | } | ||
| 23 | }); | ||
| 24 | 16 | ||
| 25 | /** | 17 | /** |
| 26 | * ScrollView有问题, | 18 | * ScrollView有问题, |
| ... | @@ -71,8 +63,9 @@ cc.Class({ | ... | @@ -71,8 +63,9 @@ cc.Class({ |
| 71 | this._oSceneContext._iPageIndex = 1; | 63 | this._oSceneContext._iPageIndex = 1; |
| 72 | this._oSceneContext._iCurrentLeftIndex = 0; | 64 | this._oSceneContext._iCurrentLeftIndex = 0; |
| 73 | this._oInit = {}; | 65 | this._oInit = {}; |
| 66 | this._iSceneStatus=0; | ||
| 74 | 67 | ||
| 75 | this.checkUpdate(); //热更新检查是否有新版本 | 68 | // this.checkUpdate(); //热更新检查是否有新版本 //放到初始化焦点框后 |
| 76 | 69 | ||
| 77 | this.getLeftBgRequest(); //渲染左侧导航 | 70 | this.getLeftBgRequest(); //渲染左侧导航 |
| 78 | this.getTopBgRequest(); //渲染顶部导航 | 71 | this.getTopBgRequest(); //渲染顶部导航 |
| ... | @@ -350,6 +343,16 @@ cc.Class({ | ... | @@ -350,6 +343,16 @@ cc.Class({ |
| 350 | 343 | ||
| 351 | //初始化焦点框 | 344 | //初始化焦点框 |
| 352 | initFocus: function () { | 345 | initFocus: function () { |
| 346 | this._aFocusTargets[1]=[]; | ||
| 347 | |||
| 348 | let fiHotUpdateClose=cc.find('update/update_panel/close',this.node).addComponent(FocusInfo); //热更新关闭按钮 | ||
| 349 | fiHotUpdateClose.init('',false,null,null,1.0); | ||
| 350 | this._aFocusTargets[1]['hot_update_close']=cc.find('update/update_panel/close',this.node); | ||
| 351 | |||
| 352 | let fiHotUpdateBtn=cc.find('update/update_panel/update_btn',this.node).addComponent(FocusInfo); //热更新按钮 | ||
| 353 | fiHotUpdateBtn.init('',false,null,null,1.0); | ||
| 354 | this._aFocusTargets[1]['hot_update_btn']=cc.find('update/update_panel/update_btn',this.node); | ||
| 355 | |||
| 353 | var nodeInitFocus = cc.find(this._oSceneContext.focusPath, this.node); | 356 | var nodeInitFocus = cc.find(this._oSceneContext.focusPath, this.node); |
| 354 | // cc.log("初始化 "+nodeInitFocus.name); | 357 | // cc.log("初始化 "+nodeInitFocus.name); |
| 355 | var nodeFocus = new cc.Node('nodeFocus'); | 358 | var nodeFocus = new cc.Node('nodeFocus'); |
| ... | @@ -358,6 +361,9 @@ cc.Class({ | ... | @@ -358,6 +361,9 @@ cc.Class({ |
| 358 | this._cFocus.init('focusContainer', this, | 361 | this._cFocus.init('focusContainer', this, |
| 359 | nodeInitFocus.getComponent(FocusInfo), | 362 | nodeInitFocus.getComponent(FocusInfo), |
| 360 | Common.SCREEN_WIDTH, Common.SCREEN_HEIGHT, 2, 6, 1.0, true); | 363 | Common.SCREEN_WIDTH, Common.SCREEN_HEIGHT, 2, 6, 1.0, true); |
| 364 | |||
| 365 | this.checkUpdate(); //热更新 | ||
| 366 | |||
| 361 | this.scheduleOnce(() => { //指定0让回调函数在下一帧立即执行 | 367 | this.scheduleOnce(() => { //指定0让回调函数在下一帧立即执行 |
| 362 | if (0 == nodeInitFocus.name.indexOf('NaviCell')) { | 368 | if (0 == nodeInitFocus.name.indexOf('NaviCell')) { |
| 363 | // nodeInitFocus.getComponent(cc.Sprite).spriteFrame.setRect(cc.rect(0, nodeInitFocus.height, nodeInitFocus.width, nodeInitFocus.height)); | 369 | // nodeInitFocus.getComponent(cc.Sprite).spriteFrame.setRect(cc.rect(0, nodeInitFocus.height, nodeInitFocus.width, nodeInitFocus.height)); |
| ... | @@ -369,7 +375,6 @@ cc.Class({ | ... | @@ -369,7 +375,6 @@ cc.Class({ |
| 369 | ); | 375 | ); |
| 370 | } | 376 | } |
| 371 | }, 0); | 377 | }, 0); |
| 372 | |||
| 373 | }, | 378 | }, |
| 374 | 379 | ||
| 375 | onBeforeFocusChange: function (event) { | 380 | onBeforeFocusChange: function (event) { |
| ... | @@ -443,7 +448,7 @@ cc.Class({ | ... | @@ -443,7 +448,7 @@ cc.Class({ |
| 443 | var fiCurrentFocus = this._fiCurrentFocus; | 448 | var fiCurrentFocus = this._fiCurrentFocus; |
| 444 | var oScrollParameter = null; | 449 | var oScrollParameter = null; |
| 445 | let aCheckResult; | 450 | let aCheckResult; |
| 446 | fiFocusTarget = this._cFocus.findTarget(fiCurrentFocus, this._aFocusTargets, 0, Direct); | 451 | fiFocusTarget = this._cFocus.findTarget(fiCurrentFocus, this._aFocusTargets, this._iSceneStatus, Direct); |
| 447 | if (!fiFocusTarget) { return; } | 452 | if (!fiFocusTarget) { return; } |
| 448 | aCheckResult = this.checkFocusTarget(fiFocusTarget); | 453 | aCheckResult = this.checkFocusTarget(fiFocusTarget); |
| 449 | fiFocusTarget = aCheckResult[0]; | 454 | fiFocusTarget = aCheckResult[0]; |
| ... | @@ -543,7 +548,18 @@ cc.Class({ | ... | @@ -543,7 +548,18 @@ cc.Class({ |
| 543 | case cc.macro.KEY.enter: | 548 | case cc.macro.KEY.enter: |
| 544 | case cc.macro.KEY.space: | 549 | case cc.macro.KEY.space: |
| 545 | case Common.ANDROID_KEY.enter: | 550 | case Common.ANDROID_KEY.enter: |
| 546 | this.doCurrentFocusTVLinkAction(Common.TV_LINK_ACTION_CLICK); | 551 | if (0 == this._fiCurrentFocus.node.name.indexOf('close')) { |
| 552 | this._iSceneStatus=0; | ||
| 553 | cc.find("update", this.node).active = false; //关闭更新面板 | ||
| 554 | let fiAfterNode=cc.find(this._oSceneContext.focusPath,this.node).getComponent(FocusInfo); //热更新按钮 | ||
| 555 | this._cFocus.flyFocus(this._fiCurrentFocus, fiAfterNode, Common.MOVE_DIRECTION_RIGHT, null, null); | ||
| 556 | } | ||
| 557 | else if(0 == this._fiCurrentFocus.node.name.indexOf('update_btn')){ | ||
| 558 | this.hotUpdate(); | ||
| 559 | } | ||
| 560 | else{ | ||
| 561 | this.doCurrentFocusTVLinkAction(Common.TV_LINK_ACTION_CLICK); | ||
| 562 | } | ||
| 547 | break; | 563 | break; |
| 548 | case cc.macro.KEY.backspace: | 564 | case cc.macro.KEY.backspace: |
| 549 | case Common.ANDROID_KEY.back: | 565 | case Common.ANDROID_KEY.back: |
| ... | @@ -706,11 +722,16 @@ cc.Class({ | ... | @@ -706,11 +722,16 @@ cc.Class({ |
| 706 | this.panel.info.string = "Already up to date with the latest remote version."; | 722 | this.panel.info.string = "Already up to date with the latest remote version."; |
| 707 | break; | 723 | break; |
| 708 | case jsb.EventAssetsManager.NEW_VERSION_FOUND: //可以更新了 | 724 | case jsb.EventAssetsManager.NEW_VERSION_FOUND: //可以更新了 |
| 709 | cc.log("可以更新了"); | 725 | cc.log("可以更新了"); //处理焦点框跳转 |
| 710 | this.panel.info.string = 'New version found, please try to update.'; | 726 | this.panel.info.string = 'New version found, please try to update.'; |
| 711 | cc.find("update", this.node).active = true; //显示出来更新面板 | ||
| 712 | this.panel.fileProgress.progress = 0; | 727 | this.panel.fileProgress.progress = 0; |
| 713 | // this.panel.byteProgress.progress = 0; | 728 | // this.panel.byteProgress.progress = 0; |
| 729 | |||
| 730 | this._iSceneStatus=1; //焦点框跳转层级 | ||
| 731 | cc.find("update", this.node).active = true; //显示出来更新面板 | ||
| 732 | let fiHotUpdateBtn=cc.find('update/update_panel/update_btn',this.node).getComponent(FocusInfo); //热更新按钮 | ||
| 733 | this._cFocus.flyFocus(this._fiCurrentFocus, fiHotUpdateBtn, Common.MOVE_DIRECTION_RIGHT, null, null); | ||
| 734 | |||
| 714 | break; | 735 | break; |
| 715 | default: | 736 | default: |
| 716 | return; | 737 | return; | ... | ... |
This diff is collapsed.
Click to expand it.
| 1 | { | 1 | { |
| 2 | "ver": "1.0.1", | 2 | "ver": "1.0.0", |
| 3 | "uuid": "00c8d4db-68f5-48fe-96ab-f5d85749c29f", | 3 | "uuid": "12f3d277-6912-4388-a876-d91854f39321", |
| 4 | "asyncLoadAssets": false, | ||
| 5 | "autoReleaseAssets": false, | ||
| 6 | "subMetas": {} | 4 | "subMetas": {} |
| 7 | } | 5 | } |
| ... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
| 1 | {"packageUrl":"http://x9niiz.natappfree.cc/remote-assets/","remoteManifestUrl":"http://x9niiz.natappfree.cc/remote-assets/project.manifest","remoteVersionUrl":"http://x9niiz.natappfree.cc/remote-assets/version.manifest","version":"2.0.0"} | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file |
| 1 | {"packageUrl":"http://x9niiz.natappfree.cc/remote-assets/","remoteManifestUrl":"http://x9niiz.natappfree.cc/remote-assets/project.manifest","remoteVersionUrl":"http://x9niiz.natappfree.cc/remote-assets/version.manifest","version":"1.0.0"} | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
-
Please register or sign in to post a comment