drgame-cc 1.0.32 → 1.0.33

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.
@@ -20,47 +20,49 @@ export class PlatformAdapter {
20
20
  var platform = GameAnalyticsPlatform.XiaomiTv;//平台由sdk后续处理
21
21
  var appItem = GameAnalytics.getAppItem(platform);
22
22
  var contentId = minigameID.toString();//InternalUitl.getChineseInitials(cnName);
23
- TvUi.init({
24
- cpId: contentId,
25
- version: this.version,
26
- designWidth: this.designWidth,
27
- designHeight: this.designHeight,
28
- enableCursor: true,
29
- configPath: "drres/config/default",
30
- focus: {
31
- enabled: true,
32
- defaultIconKey: "default"
33
- },
34
- adSdk: {
35
- platform: platform
36
- },
37
- ads: {
38
- reward: {
23
+ if (this.isCocos) {
24
+ TvUi.init({
25
+ cpId: contentId,
26
+ version: this.version,
27
+ designWidth: this.designWidth,
28
+ designHeight: this.designHeight,
29
+ enableCursor: true,
30
+ configPath: "drres/config/default",
31
+ focus: {
39
32
  enabled: true,
40
- mode: "reward",
41
- channels: [
42
- { type: "aggregate", priority: 1, reward_type: "reward" },
43
- { type: "mock", priority: 100 }
44
- ]
33
+ defaultIconKey: "default"
45
34
  },
46
- popup: {
47
- enabled: true,
48
- mode: "popup",
49
- channels: [
50
- { type: "aggregate", priority: 1 },
51
- { type: "mock", priority: 100 }
52
- ]
35
+ adSdk: {
36
+ platform: platform
53
37
  },
54
- game: {
55
- enabled: true,
56
- mode: "popup",
57
- channels: [
58
- { type: "aggregate", priority: 1 },
59
- { type: "mock", priority: 100 }
60
- ]
38
+ ads: {
39
+ reward: {
40
+ enabled: true,
41
+ mode: "reward",
42
+ channels: [
43
+ { type: "aggregate", priority: 1, reward_type: "reward" },
44
+ { type: "mock", priority: 100 }
45
+ ]
46
+ },
47
+ popup: {
48
+ enabled: true,
49
+ mode: "popup",
50
+ channels: [
51
+ { type: "aggregate", priority: 1 },
52
+ { type: "mock", priority: 100 }
53
+ ]
54
+ },
55
+ game: {
56
+ enabled: true,
57
+ mode: "popup",
58
+ channels: [
59
+ { type: "aggregate", priority: 1 },
60
+ { type: "mock", priority: 100 }
61
+ ]
62
+ }
61
63
  }
62
- }
63
- });
64
+ });
65
+ }
64
66
 
65
67
  GameAnalytics.init({
66
68
  platform: GameAnalyticsPlatform.XiaomiTv,
@@ -217,4 +219,8 @@ export class PlatformAdapter {
217
219
  public static reportBatch(events: AnalyticsEvent[]) {
218
220
  GameAnalytics.reportBatch(events);
219
221
  }
222
+
223
+ public static get isCocos() {
224
+ return window['cc'] != undefined;
225
+ }
220
226
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "drgame-cc",
3
- "version": "1.0.32",
3
+ "version": "1.0.33",
4
4
  "description": "道然游戏适配包",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",