@chiyou/minigame-framework 1.2.63 → 1.2.65

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@chiyou/minigame-framework",
3
- "version": "1.2.63",
3
+ "version": "1.2.65",
4
4
  "description": "基于 Cocos Creator 3.x 的小游戏开发框架,支持多平台发布",
5
5
  "main": "src/index.ts",
6
6
  "types": "src/index.ts",
@@ -281,24 +281,24 @@ export class AdMgr extends BaseMgr {
281
281
  }
282
282
 
283
283
  if (res === RewardedVideoAd_Callback_Status.Status_Watching) {
284
- if (this.audioMgr === null) {
285
- this.audioMgr = ServiceLocator.Instance.get<AudioMgr>("AudioMgr");
284
+ if (AdMgr.Instance.audioMgr === null) {
285
+ AdMgr.Instance.audioMgr = ServiceLocator.Instance.get<AudioMgr>("AudioMgr");
286
286
  }
287
287
 
288
- if (this.audioMgr) {
289
- this.audioMgr.pauseMusic();
288
+ if (AdMgr.Instance.audioMgr) {
289
+ AdMgr.Instance.audioMgr.pauseMusic();
290
290
  }
291
291
 
292
292
  AdMgr.Instance.hideAllPermanentAd();
293
293
  } else if (res === RewardedVideoAd_Callback_Status.Status_Complete ||
294
294
  res === RewardedVideoAd_Callback_Status.Status_Giveup ||
295
295
  res === RewardedVideoAd_Callback_Status.Status_Error) {
296
- if (this.audioMgr === null) {
297
- this.audioMgr = ServiceLocator.Instance.get<AudioMgr>("AudioMgr");
296
+ if (AdMgr.Instance.audioMgr === null) {
297
+ AdMgr.Instance.audioMgr = ServiceLocator.Instance.get<AudioMgr>("AudioMgr");
298
298
  }
299
299
 
300
- if (this.audioMgr) {
301
- this.audioMgr.resumeMusic();
300
+ if (AdMgr.Instance.audioMgr) {
301
+ AdMgr.Instance.audioMgr.resumeMusic();
302
302
  }
303
303
 
304
304
  AdMgr.Instance.showAllPermanentAd();
@@ -27,14 +27,9 @@ export abstract class BaseMgr extends Component {
27
27
  private onInit(): void {
28
28
  BaseMgr.Instance = this;
29
29
 
30
- let sysPlatform: any = sys.platform;
31
- LogUtils.Instance.info(BaseMgr.TAG, "系统平台检测", {
32
- operation: "onInit",
33
- sysPlatform: sysPlatform
34
- });
35
-
36
30
  BaseMgr.currentPlatformID = PlatformID.ID_UNKNOWN;
37
31
 
32
+ let sysPlatform: any = sys.platform;
38
33
  if (sysPlatform === sys.Platform.DESKTOP_BROWSER) {
39
34
  BaseMgr.currentPlatformID = PlatformID.ID_H5_DesktopBrowser;
40
35
  }
@@ -85,13 +80,23 @@ export abstract class BaseMgr extends Component {
85
80
 
86
81
  try {
87
82
  if (window["qg"]) {
88
- if (sysPlatform === sys.Platform.XIAOMI_QUICK_GAME) {
83
+ let provider: string = "";
84
+ if (window["qg"].getProvider) {
85
+ provider = window["qg"].getProvider().toLowerCase();
86
+ }
87
+
88
+ LogUtils.Instance.info(BaseMgr.TAG, "qg.getProvider", {
89
+ provider: provider
90
+ });
91
+
92
+ if (provider === "xiaomi" || provider === "redmi" || provider === "blackshark" ||
93
+ sysPlatform === sys.Platform.XIAOMI_QUICK_GAME) {
89
94
  BaseMgr.currentPlatformID = PlatformID.ID_QuickGame_XiaoMi;
90
- } else if (sysPlatform === sys.Platform.OPPO_MINI_GAME) {
95
+ } else if (provider === "oppo" || sysPlatform === sys.Platform.OPPO_MINI_GAME) {
91
96
  BaseMgr.currentPlatformID = PlatformID.ID_QuickGame_Oppo;
92
- } else if (sysPlatform === sys.Platform.HONOR_MINI_GAME) {
97
+ } else if (provider === "honor" || sysPlatform === sys.Platform.HONOR_MINI_GAME) {
93
98
  BaseMgr.currentPlatformID = PlatformID.ID_QuickGame_Honor;
94
- } else if (sysPlatform === sys.Platform.VIVO_MINI_GAME) {
99
+ } else if (provider === "vivo" || sysPlatform === sys.Platform.VIVO_MINI_GAME) {
95
100
  BaseMgr.currentPlatformID = PlatformID.ID_QuickGame_Vivo;
96
101
  } else if (sysPlatform === sys.Platform.HUAWEI_QUICK_GAME) {
97
102
  BaseMgr.currentPlatformID = PlatformID.ID_QuickGame_HuaWei;
@@ -100,7 +105,10 @@ export abstract class BaseMgr extends Component {
100
105
  } catch (e) {
101
106
  }
102
107
 
103
- LogUtils.Instance.info(BaseMgr.TAG, "初始化完成");
108
+ LogUtils.Instance.info(BaseMgr.TAG, "初始化完成", {
109
+ currentPlatform: PlatformID[BaseMgr.currentPlatformID],
110
+ currentPlatformID: BaseMgr.currentPlatformID
111
+ });
104
112
  }
105
113
 
106
114
  /**