@cc-component/cc-ex-component 1.1.4 → 1.1.6
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/assets/platform/Interface.ts +2 -0
- package/assets/platform/android/AndroidSDK.ts +13 -2
- package/assets/platform/base/EditorSDK.ts +12 -11
- package/assets/platform/base/PlatfprmModule.ts +1 -2
- package/assets/platform/base/SDKBase.ts +1 -1
- package/assets/platform/base/TTSDK.ts +1 -1
- package/assets/platform/base/WXSDK.ts +1 -1
- package/index.ts +2 -3
- package/package.json +1 -1
- /package/assets/ex/{BaseEx.ts → ExCommon.ts} +0 -0
- /package/assets/ex/{BaseEx.ts.meta → ExCommon.ts.meta} +0 -0
|
@@ -6,6 +6,8 @@ declare global {
|
|
|
6
6
|
/**小游戏:按钮触摸 需要在按钮onTouchEnd中调用的方法 使用这个属性*/
|
|
7
7
|
const buttonTouch: ButtonTouch;
|
|
8
8
|
//#region 通用==============
|
|
9
|
+
/**模块初始化 */
|
|
10
|
+
export function Init(): Promise<void>
|
|
9
11
|
/**登录 */
|
|
10
12
|
export function Login(data?: string): Promise<SDKLoginData>
|
|
11
13
|
/**退出登录 */
|
|
@@ -5,6 +5,7 @@ import { native } from 'cc';
|
|
|
5
5
|
import { sys } from 'cc';
|
|
6
6
|
import { ATRewardedVideoAutoAdSDK } from './AnyThinkAds/ATRewardedAutoVideo';
|
|
7
7
|
import { ATSDK } from './AnyThinkAds/ATSDK';
|
|
8
|
+
import { assetManager } from 'cc';
|
|
8
9
|
const { ccclass, property } = _decorator;
|
|
9
10
|
|
|
10
11
|
@ccclass('AndroidSDK')
|
|
@@ -39,8 +40,7 @@ export class AndroidSDK extends SDKBase {
|
|
|
39
40
|
adsParam: AdsData;
|
|
40
41
|
adsCall: AdsCall;
|
|
41
42
|
|
|
42
|
-
init(): Promise<
|
|
43
|
-
if (sys.platform !== sys.Platform.ANDROID) { return }
|
|
43
|
+
init(): Promise<boolean> {
|
|
44
44
|
native.bridge.onNative = (func: string, param?: string | null): void => {
|
|
45
45
|
switch (func) {
|
|
46
46
|
case SDKEnum.Init:
|
|
@@ -76,6 +76,17 @@ export class AndroidSDK extends SDKBase {
|
|
|
76
76
|
}
|
|
77
77
|
}
|
|
78
78
|
native.bridge.sendToNative(SDKEnum.DeviceInfo);
|
|
79
|
+
return new Promise<boolean>((resolve, reject) => {
|
|
80
|
+
assetManager.loadBundle('android', (error, bundle) => {
|
|
81
|
+
if (error) {
|
|
82
|
+
console.error('加载bundle android 失败', error)
|
|
83
|
+
resolve(true)
|
|
84
|
+
|
|
85
|
+
} else {
|
|
86
|
+
resolve(true)
|
|
87
|
+
}
|
|
88
|
+
})
|
|
89
|
+
})
|
|
79
90
|
}
|
|
80
91
|
public async login(data?: string): Promise<SDKLoginData> {
|
|
81
92
|
return new Promise<SDKLoginData>(async (resolve, reject) => {
|
|
@@ -1,29 +1,30 @@
|
|
|
1
1
|
import { _decorator, Component, Node } from 'cc';
|
|
2
2
|
import { SDKBase } from './SDKBase';
|
|
3
|
-
import { SDKLoginData, SDKStatus } from './SDKEnum';
|
|
3
|
+
import { AdsCall, AdsData, PositonData, SDKLoginData, SDKStatus } from './SDKEnum';
|
|
4
4
|
const { ccclass, property } = _decorator;
|
|
5
5
|
|
|
6
6
|
@ccclass('EditorSDK')
|
|
7
7
|
export class EditorSDK extends SDKBase {
|
|
8
|
-
init(): Promise<
|
|
9
|
-
return
|
|
8
|
+
init(): Promise<boolean> {
|
|
9
|
+
return Promise.resolve(true);
|
|
10
10
|
}
|
|
11
11
|
public login(data?: string): Promise<SDKLoginData> {
|
|
12
|
-
return
|
|
12
|
+
return Promise.resolve({ success: true, code: '200' });
|
|
13
13
|
}
|
|
14
14
|
public logout(): Promise<SDKStatus> {
|
|
15
|
-
return
|
|
15
|
+
return Promise.resolve(SDKStatus.success);
|
|
16
16
|
}
|
|
17
|
-
public
|
|
18
|
-
|
|
17
|
+
public initRewardedVideo(param: AdsData) {
|
|
18
|
+
|
|
19
19
|
}
|
|
20
|
-
public
|
|
21
|
-
|
|
20
|
+
public showRewardedVideo(param: AdsCall) {
|
|
21
|
+
param.success?.();
|
|
22
22
|
}
|
|
23
|
-
public
|
|
24
|
-
return
|
|
23
|
+
public toPosition(node: Node): PositonData {
|
|
24
|
+
return { x: 0, y: 0, width: 0, height: 0 };
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
+
|
|
27
28
|
}
|
|
28
29
|
|
|
29
30
|
|
|
@@ -13,7 +13,7 @@ export abstract class SDKBase {
|
|
|
13
13
|
|
|
14
14
|
protected _userInfo?: any;
|
|
15
15
|
public get userInfo() { return this._userInfo; }
|
|
16
|
-
abstract init(): Promise<
|
|
16
|
+
abstract init(): Promise<boolean>;
|
|
17
17
|
/**登录 */
|
|
18
18
|
public abstract login(data?: string): Promise<SDKLoginData>;
|
|
19
19
|
/**登出 */
|
|
@@ -9,7 +9,7 @@ export class TTSDK extends SDKBase {
|
|
|
9
9
|
videoAdsLoadResolve: any = null
|
|
10
10
|
adsCall: AdsCall;
|
|
11
11
|
sidebarCall: Function;
|
|
12
|
-
init(): Promise<
|
|
12
|
+
init(): Promise<boolean> {
|
|
13
13
|
const windowInfo = tt.getSystemInfoSync();
|
|
14
14
|
var options = tt.getLaunchOptionsSync();
|
|
15
15
|
const scene: string = options.scene;
|
package/index.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
// 负责导出assets下的模块,如: export { default } from './assets/xxx.ts'
|
|
2
|
-
export { } from './assets/ex/
|
|
2
|
+
export { } from './assets/ex/ExCommon';
|
|
3
3
|
export { } from './assets/video/Interface';
|
|
4
|
-
export { ReferenceCollector } from './assets/core/ReferenceCollector';
|
|
5
|
-
|
|
6
4
|
export { } from './assets/platform/Interface';
|
|
5
|
+
export { ReferenceCollector } from './assets/core/ReferenceCollector';
|
|
7
6
|
|
package/package.json
CHANGED
|
File without changes
|
|
File without changes
|