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

feat: 加入平台判断

parent 59679fbc
...@@ -408,9 +408,12 @@ cc.Class({ ...@@ -408,9 +408,12 @@ cc.Class({
}); });
cc.find('Canvas/New Button').on('click', ()=>{ cc.find('Canvas/New Button').on('click', ()=>{
if (jsb) { if (cc.sys.isNative && cc.sys.os == cc.sys.OS_IOS) {
var result = jsb.reflection.callStaticMethod('CocosMng', 'exitCocosForJS'); var result = jsb.reflection.callStaticMethod('CocosMng', 'exitCocosForJS');
console.log('result = ' + result); console.log('result = ' + result);
return;
} else if (cc.sys.isNative && cc.sys.os == cc.sys.OS_ANDROID) {
return;
} }
}); });
}, },
......
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