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.
- package/drscript/PlatformAdapter.ts +43 -37
- package/package.json +1 -1
|
@@ -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
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
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
|
-
|
|
41
|
-
channels: [
|
|
42
|
-
{ type: "aggregate", priority: 1, reward_type: "reward" },
|
|
43
|
-
{ type: "mock", priority: 100 }
|
|
44
|
-
]
|
|
33
|
+
defaultIconKey: "default"
|
|
45
34
|
},
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
mode: "popup",
|
|
49
|
-
channels: [
|
|
50
|
-
{ type: "aggregate", priority: 1 },
|
|
51
|
-
{ type: "mock", priority: 100 }
|
|
52
|
-
]
|
|
35
|
+
adSdk: {
|
|
36
|
+
platform: platform
|
|
53
37
|
},
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
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
|
}
|