Commit 72b52381 authored by liujiangnan's avatar liujiangnan

feat: 释放原生方法

parent c885c68f
...@@ -186,6 +186,13 @@ export function initAir(_this) { ...@@ -186,6 +186,13 @@ export function initAir(_this) {
throw ('非源生环境'); throw ('非源生环境');
} }
}, },
freeAllOcMethod () {
window.courseware.stopRecord();
window.courseware.stopTest();
window.courseware.closeOsmo();
window.courseware.closeOsmoHandwriting();
window.courseware.closeOsmoFingerRead();
}
}; };
} }
...@@ -220,7 +220,7 @@ cc.Class({ ...@@ -220,7 +220,7 @@ cc.Class({
exitBtn.active = false; exitBtn.active = false;
cc.game.removePersistRootNode(this.node); cc.game.removePersistRootNode(this.node);
cc.director.getScene().destroy(); cc.director.getScene().destroy();
window.courseware.freeAllOcMethod();
cc.director.loadScene("debug_shell", null, null, (err, scene) => { cc.director.loadScene("debug_shell", null, null, (err, scene) => {
}); });
}) })
...@@ -312,6 +312,9 @@ cc.Class({ ...@@ -312,6 +312,9 @@ cc.Class({
if (!this.courses || index == this.courseIndex || index < 0 || index > this.courses.length - 1) { if (!this.courses || index == this.courseIndex || index < 0 || index > this.courses.length - 1) {
return; return;
} }
window.courseware.freeAllOcMethod();
this.courseIndex = index; this.courseIndex = index;
this.courseItem = this.courses[this.courseIndex]; this.courseItem = this.courses[this.courseIndex];
if (this.courseIndex == 0) { if (this.courseIndex == 0) {
......
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