ソースを参照

[FC]:解决各类问题

fengcong 5 年 前
コミット
a71a5ed574

ファイルの差分が大きいため隠しています
+ 136 - 171
assets/resources/game/prefab/gameplay.prefab


+ 1 - 1
assets/resources/module/forceUpdate/forceUpdate.prefab

@@ -252,7 +252,7 @@
       "ctor": "Float64Array",
       "array": [
         0,
-        0,
+        75,
         0,
         0,
         0,

+ 22 - 11
assets/script/before/GamePlay.ts

@@ -93,7 +93,7 @@ export default class GamePlay extends cc.Component {
     /**当前得分 */
     public curGetScore: number = 0;
     /**目标分数 */
-    public targetScore: number = 100000;
+    public targetScore: number = 0;
     /**最终得分 */
     public finalGetScore: number = 0;
     /**增加得分速度 */
@@ -195,13 +195,13 @@ export default class GamePlay extends cc.Component {
             mk.audio.playMusic("music_gameBg");
 
             //读取在线分数数据
-            gData.gameData.setProp(GameProp.curTotalScore,0);//杀掉进程,则清零积分
+            gData.gameData.setProp(GameProp.curTotalScore, 0);//杀掉进程,则清零积分
             let score = gData.gameData.getProp(GameProp.curTotalScore);
             this.curGetScore = score;
             this.curProgressScore = score;
             this.finalGetScore = score;
             console.log("score", score);
-            
+
 
             this.initView();
             this.initEvent();
@@ -266,17 +266,15 @@ export default class GamePlay extends cc.Component {
                     let node_getTargetScoreTip = PoolMgr.Inst.getPoolPrefab(NODEPOOLPREFABTYPE.GetTargetScoreTip);
                     GamePlay.Inst.node_effectUI.addChild(node_getTargetScoreTip);
 
-                    //进度到达开始显示
-                    gData.reward.subType = 2;
-                    mk.ad.videoAdType = VideoAdType.LevelScoreRedBag;
-                    mk.ui.openPanel("module/reward/rewardLuck");
+                    //进度到达开始显示(挪到initScore判断)
+                    // gData.reward.subType = 2;
+                    // mk.ad.videoAdType = VideoAdType.LevelScoreRedBag;
+                    // mk.ui.openPanel("module/reward/rewardLuck");
                 }
 
                 this.curProgressScore = nextProgressScore;
                 if (this.curProgressScore >= this.curGetScore) {
                     this.curProgressScore = this.curGetScore;
-
-
                 }
                 this.initScore();
             }
@@ -322,6 +320,9 @@ export default class GamePlay extends cc.Component {
 
     /**初始化总分数 */
     initTotalScore() {
+        if (this.targetScore) {
+            return;
+        }
         let level = gData.gameData.getProp(GameProp.levelNum);
         //加入一些随机值,而不是都能获得过关红包
         this.targetScore = 450 + level * (5 + Math.floor(Math.random() * 15));
@@ -341,6 +342,15 @@ export default class GamePlay extends cc.Component {
         let progress = this.curProgressScore / this.targetScore;
         progress = progress > 1 ? 1 : progress;
         this.spr_progress.fillRange = progress;
+        if (progress >= 1) {
+            //进度到达开始显示
+            gData.reward.subType = 2;
+            mk.ad.videoAdType = VideoAdType.LevelScoreRedBag;
+            let node_rewardLuck = mk.ui.getCurOnPanel("rewardLuck");
+            if (!node_rewardLuck) {
+                mk.ui.openPanel("module/reward/rewardLuck");
+            }
+        }
 
         // if (progress >= 1) {
         //     this.pass();
@@ -969,14 +979,15 @@ export default class GamePlay extends cc.Component {
     /**restart
      * @param 是否扣除体力
      */
-    restart(ifMinusEnergy: boolean = false) {
+    restart() {
         mk.console.log("restart!!!!!!!!!!!!!!!")
         this.refreshGame();
     }
 
     /**下一关 */
-    nextLevel(ifMinusEnergy: boolean = false) {
+    nextLevel() {
         mk.console.log("nextLevel!!!!!!!!!!!!!!!")
+        this.targetScore = 0;//下一关才重置目标分数
         this.refreshGame();
     }
 

+ 0 - 56
assets/script/before/util/Util.ts

@@ -298,60 +298,4 @@ export default class Util {
         }
     }
 
-    //安装相关-----------------------------------------------------------------------------------------
-    /** 是否有apk安装包 */
-    static checkHasApk(fileName) {
-        var fullPath = jsb.fileUtils.getWritablePath() + fileName
-
-        if (jsb.fileUtils.isFileExist(fullPath)) {
-            return fullPath
-        }
-        else {
-            return ''
-        }
-    }
-
-    /** 下载文件
-    * @param url 下载地址
-    * @param fileName 存储文件名称
-    * @param successCb 成功回调
-    * @param failCb 失败回调
-    * @param progressCb 下载进度回调
-    */
-    static downFile2Local(url, fileName, successCb, failCb, progressCb): any {
-        var fullPath = jsb.fileUtils.getWritablePath() + fileName
-        // showModelLoadingDialog();//显示加载中模态框
-        if (jsb) {
-            var downloader = new jsb.Downloader();
-            downloader.setOnFileTaskSuccess(function () {
-                // removeModelLoadingDialog();//删除加载中模态框
-                console.log("DownLoadM setOnFileTaskSuccess", "")
-                if (successCb) {
-                    console.log("DownLoadM result... ", jsb.fileUtils.isFileExist(fullPath))
-                    console.log("DownLoadM setOnFileTaskSuccess fullPath...", fullPath)
-                    successCb(fullPath);
-                    // AdM.installApp()
-                }
-            });
-            downloader.setOnTaskError(function (task: any, errorCode: number, errorCodeInternal: number, errorStr: string) {
-                // removeModelLoadingDialog();
-                // showTips("文件下载失败!!!");
-                console.log("DownLoadM setOnTaskError", errorCode + " ; " + errorCodeInternal + " ; " + errorStr)
-                if (failCb) {
-                    failCb(fullPath);
-                }
-            });
-            downloader.setOnTaskProgress(function (task: any, bytesReceived: number, totalBytesReceived: number, totalBytesExpected: number) {
-                // removeModelLoadingDialog();
-                // showTips("文件下载失败!!!");
-                console.log("DownLoadM", bytesReceived + " ; " + totalBytesReceived + " ; " + totalBytesExpected)
-                if (progressCb) {
-                    progressCb(bytesReceived, totalBytesReceived, totalBytesExpected)
-                }
-            });
-            downloader.createDownloadFileTask(url, fullPath);//创建下载任务
-            return downloader
-        }
-    }
-
 }

+ 2 - 1
assets/script/before/view/PauseUI.ts

@@ -135,13 +135,14 @@ export default class PauseUI extends cc.Component {
         //GameMgr.Inst.sendEvent(UI_NAME.PauseUI, "点击重新开始按钮");
         GamePlay.Inst.restart();
         mk.ui.closePanel(this.node.name);
+        mk.ad.destroyNativeAd();
     }
 
     onClickExitBtn() {
         GameMgr.Inst.sendEvent(UI_NAME.PauseUI, "点击退出按钮");
 
         mk.ui.closePanel("PauseUI")
-        GamePlay.Inst.restart(false);//退出不扣体力
+        GamePlay.Inst.restart();//退出不扣体力
         GamePlay.Inst.node.active = false;
         // let timeOut = setTimeout(()=>{
         //     Main.Inst.node_start.active = true;

+ 3 - 3
assets/script/before/view/uiItem/CellItem.ts

@@ -348,9 +348,9 @@ export default class CellItem extends cc.Component {
             GamePlay.Inst.node_effectUI.addChild(node_score);
 
             if (recycleType) {
-                GamePlay.Inst.curGetScore += score;
-                GamePlay.Inst.finalGetScore += score;
-                GamePlay.Inst.initScore();
+                // GamePlay.Inst.curGetScore += score;
+                // GamePlay.Inst.finalGetScore += score;
+                // GamePlay.Inst.initScore();
             }
             else {
                 let node_scoreEnergy = PoolMgr.Inst.getPoolPrefab(NODEPOOLPREFABTYPE.ScoreEnergy);

BIN
build/jsb-link/frameworks/runtime-src/proj.android-studio/.idea/caches/build_file_checksums.ser


+ 2 - 2
build/jsb-link/frameworks/runtime-src/proj.android-studio/.idea/modules/app/EasyEliminate.iml

@@ -40,10 +40,10 @@
       <sourceFolder url="file://$MODULE_DIR$/../../../../Classes" isTestSource="false" />
     </content>
     <content url="file://$MODULE_DIR$/../../../app">
-      <sourceFolder url="file://$MODULE_DIR$/../../../app/build/generated/renderscript_source_output_dir/debug/compileDebugRenderscript/out" isTestSource="false" generated="true" />
+      <sourceFolder url="file://$MODULE_DIR$/../../../app/build/generated/source/buildConfig/debug" isTestSource="false" generated="true" />
       <sourceFolder url="file://$MODULE_DIR$/../../../app/build/generated/aidl_source_output_dir/debug/compileDebugAidl/out" isTestSource="false" generated="true" />
       <sourceFolder url="file://$MODULE_DIR$/../../../app/build/generated/source/apt/debug" isTestSource="false" generated="true" />
-      <sourceFolder url="file://$MODULE_DIR$/../../../app/build/generated/source/buildConfig/debug" isTestSource="false" generated="true" />
+      <sourceFolder url="file://$MODULE_DIR$/../../../app/build/generated/renderscript_source_output_dir/debug/compileDebugRenderscript/out" isTestSource="false" generated="true" />
       <sourceFolder url="file://$MODULE_DIR$/../../../app/build/generated/res/rs/debug" type="java-resource" generated="true" />
       <sourceFolder url="file://$MODULE_DIR$/../../../app/build/generated/res/resValues/debug" type="java-resource" generated="true" />
       <sourceFolder url="file://$MODULE_DIR$/../../../app/build/generated/source/apt/androidTest/debug" isTestSource="true" generated="true" />

BIN
build/jsb-link/frameworks/runtime-src/proj.android-studio/app/release/EasyEliminate-release.apk


BIN
build/jsb-link/frameworks/runtime-src/proj.android-studio/res/drawable/send_img.jpg


+ 18 - 43
build/jsb-link/js backups (useful for debugging)/main.index.js

@@ -5216,11 +5216,7 @@ s.getComponent(p.default).init();
 var u = 2 + 2 * (r.default.Inst.cleanedVecArr.length - 2), y = l.default.Inst.getPoolPrefab(l.NODEPOOLPREFABTYPE.EliminateScore), g = this.node.x + r.default.Inst.node_content.x, m = this.node.y + r.default.Inst.node_content.y + 30;
 y.getComponent(d.default).init(new cc.Vec2(g, m), u);
 r.default.Inst.node_effectUI.addChild(y);
-if (t) {
-r.default.Inst.curGetScore += u;
-r.default.Inst.finalGetScore += u;
-r.default.Inst.initScore();
-} else {
+if (t) ; else {
 var _ = l.default.Inst.getPoolPrefab(l.NODEPOOLPREFABTYPE.ScoreEnergy);
 _.getComponent(h.default).init(g, m, u);
 r.default.Inst.node_effectUI.addChild(_);
@@ -7409,7 +7405,7 @@ this.gameData.isWithdrawable = t.isWithdrawable;
 this.gameData.lastTime = t.lastTime;
 this.gameData.loginDays = t.loginDays;
 this.gameData.newPlayer = t.newPlayer;
-this.gameData.piggyBank = t.piggyBank;
+this.gameData.initPiggyBank(t.piggyBank);
 this.gameData.piggyBankCashTimes = t.piggyBankCashTimes;
 this.gameData.redMoney = t.redMoney;
 this.gameData.signInDay = t.signInDay;
@@ -7574,6 +7570,9 @@ gData.gameData.init_red_point = !0;
 enumerable: !1,
 configurable: !0
 });
+t.prototype.initPiggyBank = function(t) {
+this._piggyBank = t;
+};
 Object.defineProperty(t.prototype, "isWithdrawable", {
 get: function() {
 return this._isWithdrawable;
@@ -8076,7 +8075,7 @@ e.node_levelRedPacketUI = null;
 e.node_touchListenMask = null;
 e.curProgressScore = 0;
 e.curGetScore = 0;
-e.targetScore = 1e5;
+e.targetScore = 0;
 e.finalGetScore = 0;
 e.addScoreSpeed = 4;
 e.cellItemDic = {};
@@ -8211,9 +8210,6 @@ var t = this.curProgressScore + this.addScoreSpeed;
 if (t >= n.Inst.targetScore) {
 var e = s.default.Inst.getPoolPrefab(s.NODEPOOLPREFABTYPE.GetTargetScoreTip);
 n.Inst.node_effectUI.addChild(e);
-gData.reward.subType = 2;
-mk.ad.videoAdType = y.VideoAdType.LevelScoreRedBag;
-mk.ui.openPanel("module/reward/rewardLuck");
 }
 this.curProgressScore = t;
 this.curProgressScore >= this.curGetScore && (this.curProgressScore = this.curGetScore);
@@ -8248,10 +8244,12 @@ var t = gData.gameData.getProp(y.GameProp.levelNum);
 this.label_level.string = "第" + (t + 1) + "关";
 };
 e.prototype.initTotalScore = function() {
+if (!this.targetScore) {
 var t = gData.gameData.getProp(y.GameProp.levelNum);
 this.targetScore = 450 + t * (5 + Math.floor(15 * Math.random()));
 this.addScoreSpeed = 2 * Math.floor(this.targetScore / 200) + 4;
 mk.console.log("this.addScoreSpeed", this.addScoreSpeed);
+}
 };
 e.prototype.initScore = function() {
 this.initProgress();
@@ -8260,6 +8258,11 @@ e.prototype.initProgress = function() {
 var t = this.curProgressScore / this.targetScore;
 t = t > 1 ? 1 : t;
 this.spr_progress.fillRange = t;
+if (t >= 1) {
+gData.reward.subType = 2;
+mk.ad.videoAdType = y.VideoAdType.LevelScoreRedBag;
+mk.ui.getCurOnPanel("rewardLuck") || mk.ui.openPanel("module/reward/rewardLuck");
+}
 };
 e.prototype.initPropNum = function() {
 this.initHammerPropNum();
@@ -8553,14 +8556,13 @@ if (u.default.getAroundSameType(e.x, e.y, e.type, !1).length > 0) return;
 }
 this.pass();
 };
-e.prototype.restart = function(t) {
-void 0 === t && (t = !1);
+e.prototype.restart = function() {
 mk.console.log("restart!!!!!!!!!!!!!!!");
 this.refreshGame();
 };
-e.prototype.nextLevel = function(t) {
-void 0 === t && (t = !1);
+e.prototype.nextLevel = function() {
 mk.console.log("nextLevel!!!!!!!!!!!!!!!");
+this.targetScore = 0;
 this.refreshGame();
 };
 e.prototype.refreshGame = function() {
@@ -13717,11 +13719,12 @@ this.initEffectSwitchState();
 e.prototype.onClickRestartBtn = function() {
 r.default.Inst.restart();
 mk.ui.closePanel(this.node.name);
+mk.ad.destroyNativeAd();
 };
 e.prototype.onClickExitBtn = function() {
 c.default.Inst.sendEvent(c.UI_NAME.PauseUI, "点击退出按钮");
 mk.ui.closePanel("PauseUI");
-r.default.Inst.restart(!1);
+r.default.Inst.restart();
 r.default.Inst.node.active = !1;
 mk.ad.destroyNativeAd();
 };
@@ -21051,34 +21054,6 @@ if (a !== r) return a - r;
 }
 return o.length > n.length ? -1 : 0;
 };
-t.checkHasApk = function(t) {
-var e = jsb.fileUtils.getWritablePath() + t;
-return jsb.fileUtils.isFileExist(e) ? e : "";
-};
-t.downFile2Local = function(t, e, n, o, i) {
-var a = jsb.fileUtils.getWritablePath() + e;
-if (jsb) {
-var r = new jsb.Downloader();
-r.setOnFileTaskSuccess(function() {
-console.log("DownLoadM setOnFileTaskSuccess", "");
-if (n) {
-console.log("DownLoadM result... ", jsb.fileUtils.isFileExist(a));
-console.log("DownLoadM setOnFileTaskSuccess fullPath...", a);
-n(a);
-}
-});
-r.setOnTaskError(function(t, e, n, i) {
-console.log("DownLoadM setOnTaskError", e + " ; " + n + " ; " + i);
-o && o(a);
-});
-r.setOnTaskProgress(function(t, e, n, o) {
-console.log("DownLoadM", e + " ; " + n + " ; " + o);
-i && i(e, n, o);
-});
-r.createDownloadFileTask(t, a);
-return r;
-}
-};
 var e;
 t._hasOwnProperty = Object.prototype.hasOwnProperty;
 return e = o([ a ], t);

+ 2 - 2
packages-hot-update/cfg.json

@@ -7,7 +7,7 @@
         "http://",
         "https://xcx-box.oss-cn-hangzhou.aliyuncs.com/hotgame/EasyEliminateTest/baseRemote/"
     ],
-    "buildTime": 1625477127587,
-    "genTime": 1625477127587,
+    "buildTime": 1625730340868,
+    "genTime": 1625730340868,
     "genVersion": null
 }

+ 1 - 1
settings/project.json

@@ -36,6 +36,6 @@
       "enable": false
     }
   },
-  "last-module-event-record-time": 1625031035708,
+  "last-module-event-record-time": 1625723412767,
   "start-scene": "6f522a54-3e0e-404d-a06c-bec8b4307c95"
 }

この差分においてかなりの量のファイルが変更されているため、一部のファイルを表示していません