Commit c5e5cbd5 authored by 范雪寒's avatar 范雪寒

feat: callMiddleLayerFunction

parent 3d36cbfc
...@@ -422,3 +422,13 @@ export function onHomeworkFinish() { ...@@ -422,3 +422,13 @@ export function onHomeworkFinish() {
console.log('onHomeworkFinish'); console.log('onHomeworkFinish');
} }
} }
export function callMiddleLayerFunction(apiName: string, data: any, callback: Function) {
const middleLayer = cc.find('middleLayer');
if (middleLayer) {
const middleLayerComponent = middleLayer.getComponent('middleLayer');
middleLayerComponent.callMiddleLayerFunction(apiName, data, callback);
} else {
console.log('callMiddleLayerFunction: ' + apiName);
}
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment