drgame-cc 1.0.47 → 1.0.49

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -70,7 +70,7 @@ export class PlatformAdapter {
70
70
  UIAdapter.back.setFallback(() => UIAdapter.backHandler());
71
71
  }
72
72
 
73
- private static get isXiaomi() {
73
+ public static get isXiaomi() {
74
74
  if (typeof window === 'undefined') return null;
75
75
  return window['AppBridge'] || null;
76
76
  }
@@ -20,13 +20,18 @@ export default class ExitWin extends cc.Component {
20
20
  this.node.destroy();
21
21
  }
22
22
 
23
- private onClickExit() {
24
- if (PlatformAdapter.isWebBridge) {
23
+ private async onClickExit() {
24
+ console.log("onClickExit", PlatformAdapter.isXiaomi, PlatformAdapter.isWebBridge);
25
+ if (PlatformAdapter.isXiaomi) {
26
+ console.log("onClickExit Xiaomi");
27
+ await AdSdk.exitGame();
28
+ } else if (PlatformAdapter.isWebBridge) {
29
+ console.log("onClickExit WebBridge");
25
30
  PlatformAdapter.webBridge.callHandler("router/navigateBack", {}, (a) => { cc.log(a); });
26
- return;
31
+ } else {
32
+ console.log("onClickExit Other");
33
+ cc.game.end();
27
34
  }
28
- if (AdSdk.exitGame) AdSdk.exitGame();
29
- cc.game.end();
30
35
  }
31
36
 
32
37
  onDisable() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "drgame-cc",
3
- "version": "1.0.47",
3
+ "version": "1.0.49",
4
4
  "description": "道然游戏适配包",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",